Skip to content
CheapLLM

Connect CheapLLM to Claude Code

Point Claude Code at the Messages API through the CheapLLM-compatible gateway.

12 min readUpdated Nov 2026

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.

Bash or Zsh
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.

Bash or Zsh
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.

Terminal
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.

Claude Code
/status

Top models to run in Claude Code

All 48+ models →
ModelOfficial (in / out)CheapLLM (in / out)Savings
Claude Opus 5.5$4.00 / $20.00$2.80 / $14.00−30%
GPT-6.1 Sol$2.00 / $10.00$1.40 / $7.00−30%
Gemini 4 Argon$2.00 / $10.00$1.40 / $7.00−30%
DeepSeek V4 Pro 0813$0.11 / $4.44$0.078 / $3.11−30%
← All 54 setup guides