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

  1. Create an account at api.tokenmilo.com and top up.
  2. Open Tokens in the console, click Add token and copy the key (starts with sk-).
  3. Your base URL is https://api.tokenmilo.com — without /v1.

2. Install Claude Code

macOS / Linux

curl -fsSL https://claude.ai/install.sh | bash

Windows (PowerShell)

irm https://claude.ai/install.ps1 | iex

npm (any OS)

# requires Node.js 18+
npm install -g @anthropic-ai/claude-code
claude --version

3. 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
claude

Windows PowerShell:

$env:ANTHROPIC_BASE_URL = "https://api.tokenmilo.com"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-tokenmilo-key"
claude

Option 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
ModelBest forInput / output per 1M
claude-sonnet-5-5Default for everyday coding$0.423 / $2.13
claude-opus-5-5Complex refactors and hard bugs$0.855 / $4.26
claude-fable-5-2The hardest, longest autonomous tasks$1.79 / $8.95
claude-haiku-5-5Background 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

SymptomFix
401 / invalid api keyKey copied incorrectly, or both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN are set. Keep one.
404 / not foundBase URL ends with /v1, or the model ID is misspelled. See the model list.
Insufficient quotaAccount balance or the token’s limit is used up — top up or raise the token limit.
Still asks to log inApply the onboarding fix above and make sure settings.json is valid JSON.
Connection timeoutCheck 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

Need an API key?

Sign up at TokenMilo, top up, and create a key in the console in under a minute.

Get API key See all models