Skip to content
Every guide

Guide · Claude Code

Use ScaledThought with Claude Code

Claude Code can set up ScaledThought from one prompt: it runs our CLI, writes an OpenAI-compatible API key to ./.env, asks you to approve a prepaid top-up, and can add the ScaledThought MCP server so it manages keys, budgets and billing for you.

Deep links into apps you have installed. Claude and Claude Code are trademarks of Anthropic; Codex is a trademark of OpenAI. ScaledThought is not affiliated with or endorsed by either.

Or run it yourself:

Before you start

ScaledThought serves OpenAI-compatible endpoints (/v1/chat/completions, /v1/responses) for the code Claude Code writes and runs: your app, scripts, batch jobs and evals. It also accepts Anthropic Messages API requests (/v1/messages), so you can point Claude Code itself at ScaledThought's open-weight models with ANTHROPIC_BASE_URL. Those answers come from ScaledThought's models, not Claude.

01

Create the account

Paste the prompt above into your coding agent, or run the command yourself in your project's directory. It creates the account, writes ST_API_KEY and ST_BASE_URL to ./.env (mode 0600) and adds .env to .gitignore. Only the US region is open; Canada is coming soon.

shell
npx -y scaledthought@0.3 init --region us --source org-claude-code

02

Buy credits

Usage is prepaid, so a new account answers 402 insufficient_credits until its first top-up. This prints a payment link and opens it in your browser; nothing is charged until you pay on it. How prepaid credits work

shell
npx -y scaledthought@0.3 billing topup --amount-usd 20
npx -y scaledthought@0.3 billing wait

03

Paste the prompt

Paste the prompt above into Claude Code in your project's directory. It reads /llms.txt, the setup protocol written for agents, and runs npx -y scaledthought@0.3 init --region us. The key goes to ./.env as ST_API_KEY (mode 0600, git-ignored) and is never printed.

04

Add the MCP server (optional)

For account tools inside Claude Code (usage, keys, budgets, billing), ask it to run npx -y scaledthought@0.3 mcp, which prints the exact command for your region. Run it in a shell where ST_API_KEY is loaded, because the shell expands it. The MCP server can't create accounts and doesn't serve inference: that stays on the API.

shell
set -a; . ./.env; set +a   # load ST_API_KEY
claude mcp add --transport http scaledthought https://api.us.scaledthought.com/mcp --header "Authorization: Bearer $ST_API_KEY"

05

Point Claude Code at ScaledThought models (optional)

To run Claude Code on ScaledThought's open-weight models instead of Claude, start it with these variables. Requests it sends under a Claude model name are answered by a ScaledThought model, and Anthropic's server tools, such as web search, are not available. npx -y scaledthought@0.3 models --live lists every model live in your region; the examples use deepseek-v4-1-flash.

shell
set -a; . ./.env; set +a  # puts ST_API_KEY in the environment
export ANTHROPIC_BASE_URL=https://api.us.scaledthought.com  # your region's host, without /v1
export ANTHROPIC_AUTH_TOKEN="$ST_API_KEY"
export ANTHROPIC_MODEL=deepseek-v4-1-flash  # or a model id from `npx -y scaledthought@0.3 models --live`
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-1-flash  # Claude Code's small background tasks
claude

06

Let it find where a model fits

The setup protocol ends by asking Claude Code to look through your project (read-only, on your machine) for model calls and bulk jobs, and to give you a table of what could move and which live model could serve it. It changes code only after you pick.

Notes

  • Each place that runs code can get its own sub-agent key with a daily budget: npx -y scaledthought@0.3 keys put github --repo <owner/repo> --budget-usd 2 stores it as a GitHub Actions secret through gh, never printed.

Sources

Questions

Can Claude Code itself run on ScaledThought models?
You can point it at them: ScaledThought accepts Anthropic Messages API requests at POST /v1/messages, so set ANTHROPIC_BASE_URL to your region's API host, ANTHROPIC_AUTH_TOKEN to your key and ANTHROPIC_MODEL to a live model id. The answers come from ScaledThought's open-weight models, not Claude, and are billed from your credits like chat completions.
Does Claude Code see my API key?
init writes the key to ./.env and never prints it, and the setup protocol tells the agent not to print, paste or commit it. MCP reads it from the environment.

Read next

ScaledThought is not affiliated with or endorsed by the makers of Claude Code. Claude Code is a trademark of its owner. Not affiliated with or endorsed by Anthropic, OpenAI, Cursor or any model publisher. Claude, Claude Code, Codex, Cursor, OpenAI and model names are trademarks of their owners.

Agent view · paste this into your agent

Opens your agent with the prompt typed. You press Enter.

Deep links into apps you have installed. Claude and Claude Code are trademarks of Anthropic; Codex is a trademark of OpenAI. ScaledThought is not affiliated with or endorsed by either.

Agents can read the whole site as markdown at scaledthought.com/llms.txt.