Connect CheapLLM to Claude Code
Point Claude Code at the Messages API through the CheapLLM-compatible gateway.
1. Prepare your API key
Create a CheapLLM key. Claude Code reads the gateway token from ANTHROPIC_AUTH_TOKEN, so assign the value of CHEAPLLM_API_KEY to that variable. Note that the CheapLLM site is still a demonstration and the API does not accept requests yet; the configuration below is the target setup.
export CHEAPLLM_API_KEY="YOUR_CHEAPLLM_API_KEY"
export ANTHROPIC_AUTH_TOKEN="$CHEAPLLM_API_KEY"
2. Set the API address
Give ANTHROPIC_BASE_URL the root server address without the /v1 suffix: Claude Code appends /v1/messages itself, so requests end up at https://api.cheapllm.com/v1/messages.
export ANTHROPIC_BASE_URL="https://api.cheapllm.com"
3. Start Claude Code
Run claude from the same terminal where both variables are set. If your gateway expects an API key rather than a bearer token, use the ANTHROPIC_API_KEY setup documented by that gateway instead.
claude
4. Verify the settings
Inside Claude Code run /status and check that the CheapLLM address and the credential source are shown. Then send a short prompt to confirm the model answers.
/status
Top models to run in Claude Code
All 48+ models →| Model | Official (in / out) | CheapLLM (in / out) | Savings |
|---|---|---|---|
| Claude Opus 5.5 | $2.80 / $14.00 | −30% | |
| GPT-6.1 Sol | $1.40 / $7.00 | −30% | |
| Gemini 4 Argon | $1.40 / $7.00 | −30% | |
| DeepSeek V4 Pro 0813 | $0.078 / $3.11 | −30% |