How to use Claude Code with any model (Claude, GPT, DeepSeek…)
Point Claude Code at an Anthropic-compatible endpoint with two environment variables, then switch between Claude and non-Claude models from inside the session.
Claude Code is one of the best coding agents available, and it doesn't care where its tokens come from — it only needs an Anthropic-compatible endpoint. That means you can run it through Apixo and use any model we offer.
Step 1 — get your key and base URL
Sign in, open the dashboard and copy two values:
- your API key (
sk-…) - the base URL — for Claude Code, use it without
/v1
Step 2 — configure Claude Code
The quickest way is environment variables:
export ANTHROPIC_BASE_URL=https://YOUR-BASE-URL
export ANTHROPIC_AUTH_TOKEN=sk-your-key
export ANTHROPIC_MODEL=claude-sonnet-5
claudeTo make it permanent, put the same values in ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://YOUR-BASE-URL",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key",
"ANTHROPIC_MODEL": "claude-sonnet-5"
}
}Or skip the typing: Dashboard → Setup → Claude Code gives you this file with your key already inside.
Step 3 — switch models mid-session
Inside Claude Code, run:
/model gpt-6-lunaAny ID from the models page works. A common pattern:
- a strong model for planning and hard refactors,
- a fast, cheap model for routine edits and tests.
Why it stays cheap
Claude Code re-sends a large, mostly unchanged context on every turn. Those repeated tokens are served from the prompt cache and billed at the cache price — often around a tenth of normal input. Your usage page shows exactly how much caching saved you.
Troubleshooting
| Symptom | Fix |
|---|---|
401 |
Re-copy the key; make sure there are no spaces |
404 on every request |
You added /v1 to ANTHROPIC_BASE_URL — remove it |
402 |
Balance is empty — top up |
| Model not found | Check the exact ID on the models page |
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key