HomeClaude Code › Models
OverviewInstallCLI referencePricing & limitsAgent SDKSkills & pluginsGitHubWeb, desktop & IDEModelsErrorsOpen source?TutorialFor studentsQA automation中文指南
Last updated: September 22, 2026

Which model Claude Code uses, and how to change it

Claude Code defaults to the current Sonnet-tier model — the balance point between capability and cost for an agent that makes hundreds of calls. Everything about that choice is adjustable.

TLDR

  • Default: the Sonnet tier. Opus for hard reasoning, Haiku for cheap background tasks.
  • Switch per session with --model, mid-session with /model.
  • Override each tier with ANTHROPIC_DEFAULT_SONNET_MODEL / _OPUS_MODEL / _HAIKU_MODEL.
  • This gateway currently serves 28 Claude model ids; the list below is read live.

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 idType
claude-3-5-haiku-20241022base model
claude-3-5-sonnet-20240620base model
claude-3-5-sonnet-20241022base model
claude-3-7-sonnet-20250219base model
claude-fable-5base model
claude-fable-5-1base model
claude-haiku-4-5base model
claude-haiku-4-5-20251001base model
claude-opus-4-1-20250805base model
claude-opus-4-20250514base model
claude-opus-4-5-20251101base model
claude-opus-4-6base model
claude-opus-4-7base model
claude-opus-4-8base model
claude-opus-5base model
claude-sonnet-4-20250514base model
claude-sonnet-4-5-20250929base model
claude-sonnet-4-6base model
claude-sonnet-5base model
claude-opus-4-6 (1M)long context
claude-opus-4-6-thinkingextended thinking
claude-opus-4-7 (1M)long context
claude-opus-4-7-thinkingextended thinking
claude-opus-4-8 (1M)long context
claude-opus-4-8-thinkingextended thinking
claude-opus-5 (1M)long context
claude-opus-5-thinkingextended 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

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 plans

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

More Claude Code guides

Claude Code: the complete guideHow to install Claude CodeClaude Code CLI documentation: commands and flagsClaude Code pricing and limits, explainedThe Claude Code SDK, now the Claude Agent SDKClaude Code skills and pluginsClaude Code in GitHub: the App, the Action and @claudeDoes Claude Code have a web interface? Web, desktop and IDE explainedClaude Code errors and how to fix themIs Claude Code open source?Claude Code tutorial: your first real sessionClaude Code for studentsHow to use Claude Code for QA automationClaude Code 怎么用:从安装到日常使用