How to change the model in Claude Code
claude --model claude-opus-5 # for this session
/model # inside a session: pick from a menu
/model claude-sonnet-5 # or name it
Per-tier overrides
Claude Code thinks in tiers — Sonnet, Opus, Haiku — and maps each to a concrete model id. Override the mapping with environment variables, which is how you pin a version or route a tier to a different model on the gateway:
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
The Haiku tier matters more than it looks: Claude Code uses it for lightweight internal tasks, so pointing it at a cheap model trims cost on every session.
Claude Code models list: every id this gateway serves
| Model id | Type |
|---|---|
claude-3-5-haiku-20241022 | base model |
claude-3-5-sonnet-20240620 | base model |
claude-3-5-sonnet-20241022 | base model |
claude-3-7-sonnet-20250219 | base model |
claude-fable-5 | base model |
claude-fable-5-1 | base model |
claude-haiku-4-5 | base model |
claude-haiku-4-5-20251001 | base model |
claude-opus-4-1-20250805 | base model |
claude-opus-4-20250514 | base model |
claude-opus-4-5-20251101 | base model |
claude-opus-4-6 | base model |
claude-opus-4-7 | base model |
claude-opus-4-8 | base model |
claude-opus-5 | base model |
claude-sonnet-4-20250514 | base model |
claude-sonnet-4-5-20250929 | base model |
claude-sonnet-4-6 | base model |
claude-sonnet-5 | base model |
claude-opus-4-6 (1M) | long context |
claude-opus-4-6-thinking | extended thinking |
claude-opus-4-7 (1M) | long context |
claude-opus-4-7-thinking | extended thinking |
claude-opus-4-8 (1M) | long context |
claude-opus-4-8-thinking | extended thinking |
claude-opus-5 (1M) | long context |
claude-opus-5-thinking | extended thinking |
claude-sonnet-4-6 (1M) | long context |
Variants with (1M) use the long-context tier; -thinking variants enable extended thinking. Any id above works in --model, /model and the tier variables when ANTHROPIC_BASE_URL is set to https://aiprimetech.io.
Choosing
- Sonnet tier — the default for a reason: strong at code, a third of Opus pricing.
- Opus tier — architecture decisions, hard debugging, long autonomous runs where a wrong step is expensive.
- Haiku tier — classification, summarisation, subagent scouting; not for the main edit loop.
- Start one tier lower than instinct says, escalate with /model only when quality actually fails.
Frequently asked questions
What is the default model in Claude Code?
The current Sonnet-tier model. It can be changed with --model, /model, or the ANTHROPIC_DEFAULT_SONNET_MODEL variable.
Can Claude Code use Opus?
Yes — claude --model with an Opus id, or /model during a session. Expect roughly 2.5× the per-token cost of Sonnet.
Why does Claude Code say a model is not supported?
The id is not served by the endpoint you are pointed at. Check /v1/models on that endpoint, or the list above for this gateway.
Run Claude Code on the gateway
Same models, two environment variables, credits at 7.69× face value — or a flat-rate unlimited plan.
Get an API key See unlimited plansAI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.