Claude Code setup
No Claude subscription needed. Install Claude Code, set two environment variables, and code with full-power Claude models at a fraction of the official API price.
Updated 2026-11-16
1. Before you start
- Create an account at api.tokenmilo.com and top up.
- Open Tokens in the console, click Add token and copy the key (starts with
sk-). - Your base URL is
https://api.tokenmilo.com— without/v1.
2. Install Claude Code
macOS / Linux
curl -fsSL https://claude.ai/install.sh | bashWindows (PowerShell)
irm https://claude.ai/install.ps1 | iexnpm (any OS)
# requires Node.js 18+
npm install -g @anthropic-ai/claude-code
claude --version3. Point Claude Code at TokenMilo
Option A: environment variables (quick test)
export ANTHROPIC_BASE_URL=https://api.tokenmilo.com
export ANTHROPIC_AUTH_TOKEN=sk-your-tokenmilo-key
claudeWindows PowerShell:
$env:ANTHROPIC_BASE_URL = "https://api.tokenmilo.com"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-tokenmilo-key"
claudeOption B: settings.json (recommended)
Edit ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json):
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.tokenmilo.com",
"ANTHROPIC_AUTH_TOKEN": "sk-your-tokenmilo-key",
"ANTHROPIC_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
}
}The model variables are optional. ANTHROPIC_MODEL sets the default; the other three map Claude Code’s Opus / Sonnet / Haiku tiers to concrete model IDs.
Skip the login screen
If the first run still asks you to sign in to Anthropic, add this to ~/.claude.json and restart:
{
"hasCompletedOnboarding": true
}4. Choose a model
# pick a model at launch
claude --model claude-opus-5-5
# switch inside a session
/model claude-fable-5-2
# show the active endpoint and model
/status| Model | Best for | Input / output per 1M |
|---|---|---|
| claude-sonnet-5-5 | Default for everyday coding | $0.423 / $2.13 |
| claude-opus-5-5 | Complex refactors and hard bugs | $0.855 / $4.26 |
| claude-fable-5-2 | The hardest, longest autonomous tasks | $1.79 / $8.95 |
| claude-haiku-5-5 | Background tasks and sub-agents | $0.108 / $0.531 |
5. Verify
Run /status inside Claude Code and check that the API URL is https://api.tokenmilo.com. Send a prompt, then open the console’s Logs page — you should see the request with its model, tokens and cost.
6. Troubleshooting
| Symptom | Fix |
|---|---|
| 401 / invalid api key | Key copied incorrectly, or both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN are set. Keep one. |
| 404 / not found | Base URL ends with /v1, or the model ID is misspelled. See the model list. |
| Insufficient quota | Account balance or the token’s limit is used up — top up or raise the token limit. |
| Still asks to log in | Apply the onboarding fix above and make sure settings.json is valid JSON. |
| Connection timeout | Check for a stale HTTPS_PROXY / HTTP_PROXY variable. |
FAQ
Do I need a Claude Pro or Max subscription?
No. Claude Code works with any Anthropic-compatible API key. With TokenMilo you pay per token instead of a monthly subscription.
Is it the full Claude model?
Yes. Requests go to the genuine Anthropic models. All Claude Code features — file edits, shell commands, sub-agents, MCP — work as usual.
ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY?
Use ANTHROPIC_AUTH_TOKEN; Claude Code uses it without an extra confirmation prompt. Don’t set both.
Should the base URL include /v1?
No. Claude Code appends /v1/messages itself — use exactly https://api.tokenmilo.com.
How much does a day of Claude Code cost?
It depends on the project and model. Claude Code uses prompt caching automatically, so most input tokens are billed at the cache-read rate (about 90% cheaper than regular input). Every request and its cost is listed on the Logs page of the console.
Related guides
- Codex CLI setup — Use OpenAI Codex CLI with GPT-6 via a custom provider.
- Cursor setup — Add Claude and GPT models to Cursor with your own key.
- Cline setup (VS Code) — Configure the Cline coding agent with Claude via TokenMilo.
- Cherry Studio setup — Chat with Claude and GPT in the Cherry Studio desktop app.
- Quickstart — Get a key and make your first request in minutes.
Need an API key?
Sign up at TokenMilo, top up, and create a key in the console in under a minute.