Claude Code models: what each alias means, how to change model, and what each costs

Dmitriy Solodukha · checked against Caprock v0.140.1

Which models Claude Code can use, what opus, sonnet, haiku, fable and opusplan mean today, how to change model, and what each cost on one machine.

Claude Code supports Claude models only: Opus, Sonnet, Haiku and Fable. You pick one by alias (opus, sonnet, haiku, fable) or by full model ID, and change it mid-session with /model. On the Anthropic API today opus is Opus 5.5 and sonnet is Sonnet 5.5, and Opus 5.5 is the default on every Claude plan.

Claude Code models list: the aliases today

An alias points at the recommended version for your provider and moves when Anthropic ships a new one. These are the targets on the Anthropic API:

Claude Code model aliases on the Anthropic API, from Anthropic's model configuration docs, read 20 October 2026.
AliasResolves toFor
defaultyour account's default: Opus 5.5clearing an override
opusOpus 5.5complex reasoning
sonnetSonnet 5.5daily coding
haikuHaiku 5.5simple tasks
fableFable 5.1the hardest, longest tasks
bestFable 5.1 where available, else opusthe top model you can use
opusplanOpus in plan mode, Sonnet afterplanning, then executing
opus[1m], sonnet[1m]the same model with a 1M window; no effect on Opus 5.5 or Sonnet 5.5, which already have itlong sessions
Haiku 4.5 is now a legacy model, per Anthropic's models overview read 20 October 2026; pick it by its full ID, claude-haiku-4-5, if you want it. Opus 5.5 needs Claude Code v2.1.280 or later, Sonnet 5.5 v2.1.284 and Haiku 5.5 v2.1.293; run claude update if a request for one fails.

The targets differ by provider:

  • Amazon Bedrock and Google Cloud's Agent Platform: opus is Opus 5.5, sonnet is Sonnet 4.5.
  • Claude Platform on AWS: opus is Opus 5.5, sonnet is Sonnet 4.6.
  • Microsoft Foundry: opus is Opus 4.6, sonnet is Sonnet 4.5, and default is Sonnet 4.5.

On all of them haiku is still Haiku 4.5.

To stay on one version, use the full ID, such as claude-opus-5-5, or set ANTHROPIC_DEFAULT_OPUS_MODEL (and the _SONNET_, _HAIKU_, _FABLE_ variants). Fable 5 stays selectable by its full ID, claude-fable-5.

The 1M window: on the Anthropic API, Opus 4.7 and later, Sonnet 5 and later, Haiku 5.5 and both Fable models run with a 1M context window on every plan, including Pro, with no [1m] to select. The suffix matters for Opus 4.6 and Sonnet 4.6.

How to change model in Claude Code

  1. 1

    Switch in a session and save it as your default

  2. 2

    Open the picker; Enter saves, s switches for this session only

  3. 3

    Start one session on a model

  4. 4

    Pin a version

When more than one is set, this order wins: /model in the session, then --model, then ANTHROPIC_MODEL, then the model key in settings, then ANTHROPIC_DEFAULT_MODEL. The settings key looks like this:

{
  "model": "opus"
}

Put it in ~/.claude/settings.json for every project, or in .claude/settings.local.json to change your own sessions in one project without changing your team's committed file.

  • Check the current model: /status, or your status line if it shows one.
  • Switching costs a cache miss. Each model has its own prompt cache, so the first request after /model re-reads the whole conversation uncached. Claude Code asks you to confirm only while the cache is still warm.
  • A resumed session keeps its model. claude --resume and --continue restore the model the transcript was using, unless you pass --model or set ANTHROPIC_MODEL (or an ANTHROPIC_DEFAULT_*_MODEL variable). On Bedrock, Agent Platform and Foundry the transcript model is not restored.
  • A new session started on another model: a project or managed model, ANTHROPIC_MODEL in your shell, or an organization default your admin set to override user choices outranks your /model choice. The startup header names the settings file that set it.

Claude Code Opus, Sonnet, Haiku or Fable

Anthropic's cost advice is direct: Sonnet handles most coding tasks well and costs less than Opus; keep Opus for complex architecture and multi-step reasoning, and use model: haiku for simple subagents. Fable is for work larger than one sitting: long autonomous sessions and ambiguous problems such as root-cause investigations.

List prices per million tokens, input and output, from Anthropic's pricing page:

  • Fable 5.1: $10 and $50.
  • Opus 5.5: $4 and $20. Opus 5 and Opus 4.8 are $5 and $25.
  • Sonnet 5.5 and Sonnet 5: $2 and $10.
  • Haiku 5.5: $0.10 and $0.50 on prompts up to 100,000 tokens, $0.50 and $2.50 above that.
  • Haiku 4.5: $1 and $5.

Cache reads, cache writes and every other model: Claude API pricing.

opusplan splits the difference: Opus while you are in plan mode, Sonnet once you execute. Each toggle is a model switch, so it starts a fresh cache.

What each plan allows

  • Every plan gets Opus 5.5 by default: Pro, Max, Team, Enterprise and the API.
  • Fable can bill to usage credits instead of your plan's limits, depending on your plan and seat. The /model picker then says "Requires usage credits", and Claude Code asks before the first such request in an interactive session. With -p it bills without asking.
  • Model-specific limits: after "You've hit your Opus limit" or "You've hit your Sonnet limit", switching to the other family with /model keeps you working. The session and weekly limits are shared by all models, so switching does not help there; see Claude usage limits.
  • Admins can restrict the list with availableModels in managed settings; then /model, --model and your own model key pick only from it.

Which model a subagent uses

A subagent's model comes from, in order: the model Claude passes for that call, the model field in its definition (inherit means yours), the CLAUDE_CODE_SUBAGENT_MODEL variable, then the main conversation's model. So /model opus also moves every subagent that inherits. To keep one on a smaller model, set model: haiku in its file. /tasks names the model on each running subagent's row. More in Claude Code subagents.

Can Claude Code use other models, or local models?

Besides Anthropic's API, Claude Code reaches Claude through cloud providers and gateways, each with its own switch:

  • Amazon Bedrock: CLAUDE_CODE_USE_BEDROCK=1; the model ids become inference profiles such as us.anthropic.claude-opus-5-5: Claude Code on Bedrock.
  • Google Cloud's Agent Platform (formerly Vertex AI): CLAUDE_CODE_USE_VERTEX=1.
  • Microsoft Foundry: CLAUDE_CODE_USE_FOUNDRY=1.
  • An LLM gateway your organization runs: ANTHROPIC_BASE_URL plus a gateway credential.

All of them serve Claude models, as does Claude Platform on AWS. Anthropic's docs are explicit about the rest: ANTHROPIC_BASE_URL "changes where requests are sent, not which model answers them", and Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway". Third-party gateway products exist; Anthropic does not endorse, maintain or audit them. A local model behind a proxy that imitates Anthropic's API is outside what Anthropic supports.

Two things change on these routes. On Bedrock, Agent Platform, Foundry and the Claude apps gateway, the /model picker shows no prices, because the provider sets them; through a gateway that proxies Anthropic's API it still shows list prices. And with a gateway credential active, your claude.ai plan's limits do not apply: the traffic is billed per token to whoever owns the credential.

Claude Code with Ollama

Ollama documents its own route: it serves part of Anthropic's Messages API, and Claude Code points at it with ANTHROPIC_BASE_URL. That is the non-Claude case Anthropic does not support, so what works is Ollama's to say. From Ollama's docs, read 8 October 2026:

  1. 1

    Start Claude Code through Ollama

  2. 2

    Or point Claude Code at a local Ollama server yourself

  3. 3

    Give it Ollama's placeholder token and no Anthropic key

  4. 4

    Start it on a local model

  • Context: Ollama asks for a local model with a context window of 64K tokens or more.
  • Not supported: Ollama's API does not support prompt caching, token counting or tool_choice, and its token counts are approximations.
  • Ollama Cloud: set ANTHROPIC_BASE_URL=https://ollama.com with an Ollama API key to run hosted models with no local install.
  • Your Claude plan: the requests go to Ollama, not Anthropic, so they use none of it.

Caprock has no Ollama prices. A model missing from its price table, such as qwen3.5, shows as unpriced with its token count, never as $0; a model whose name starts with one Caprock does price is priced at that maker's list price, not at what Ollama charges.

What each model cost on my machine

Every Claude Code call on my machine from 18 July to 5 October 2026, read with caprock export and priced at Anthropic's list prices: 88,890 API calls, $14,460. It is one heavy user's machine, not a benchmark and not a bill.

57.9%
of the list-price cost was Opus 5: $8,378 from 45,024 calls
26.6%
was Opus 4.8: $3,844 from 20,993 calls
9 of 71
sessions with main-thread calls used more than one model
Cost by model, Claude Code, 18 July – 5 October 2026, one machine, at list price.
ModelCallsCostShare
Opus 545,024$8,37857.9%
Opus 4.820,993$3,84426.6%
Opus 5.514,057$8806.1%
Fable 51,860$8565.9%
Sonnet 56,829$5013.5%
Haiku 4.5122$1—

Where a call is made matters as much as the model. A main-thread call carries the whole conversation; a subagent starts fresh.

  • Main thread, per call: Fable 5 $0.541, Opus 4.8 $0.302, Opus 5 $0.282, Sonnet 5 $0.115.
  • Subagents, per call: about $0.054 on Opus 5, 4.8 and 5.5, $0.027 on Sonnet 5, $0.009 on Haiku 4.5.
  • Opus 5.5 on the main thread: $0.083 a call, but every Opus 5.5 call here came from 29 September on, weeks after I capped the auto-compact window at 500K on 9 September. Part of that gap is the smaller context, not the lower rate.
  • Haiku 4.5: all 122 calls came from subagents or background work, none from the main thread.

See your own model mix

/usage shows token use for the session in front of you. Caprock keeps every session on the machine and prices each turn per model from its own pricing table:

  • Cost screen, Model mix: each model with its turns, tokens, cost and share of the total, for the range you pick.
  • Lifetime screen, Model mix: cost by model over everything Caprock has seen (or today, 7d, 30d), as a donut or a table of tokens, cost and share.
  • caprock report: prints the top five models by cost; --json adds each one's turns.
  • caprock export: one row per turn (and per tool call), with a model column, which is how the figures above were read.

On the Cost screen, a model missing from the pricing table shows "unpriced" rather than $0.00.

$ caprock export --agent claude --since 90d --out events.tsv

Caprock records every session on your machine whether or not it started it, and every dollar it shows is a list-price estimate, as Claude Code's own /usage is, beside the plan's dollars and the share of the weekly limit the work used. Free, open source; nothing leaves your machine. Install Caprock.

Questions people ask

Which models can Claude Code use?
Claude Code supports Claude models only: Opus, Sonnet, Haiku and Fable, by alias or full model ID. On the Anthropic API, opus is Opus 5.5, sonnet is Sonnet 5.5, haiku is Haiku 5.5 and fable is Fable 5.1.
How do I change the model in Claude Code?
Run /model with an alias such as /model sonnet inside a session, start with claude --model opus, or set "model" in ~/.claude/settings.json. /model saves your choice as the default for new sessions.
Can Claude Code use local or other models?
Anthropic doesn't support routing Claude Code to non-Claude models through any gateway. It supports Claude through the Anthropic API, Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and LLM gateways.
Can I use Claude Code with Ollama?
Ollama documents it: run ollama launch claude, or set ANTHROPIC_BASE_URL to a local Ollama server. Anthropic does not support routing Claude Code to non-Claude models, and Ollama's API leaves out prompt caching.
What is the default model in Claude Code?
Opus 5.5 on Pro, Max, Team, Enterprise and the Anthropic API, and on Bedrock and Google Cloud's Agent Platform. On Microsoft Foundry it is Sonnet 4.5. Fable is never the default.
Is Opus or Sonnet better for Claude Code?
Anthropic says Sonnet handles most coding tasks well and costs less; keep Opus for complex architecture and multi-step reasoning. Opus 5.5 lists at $4 and $20 per million input and output tokens, Sonnet 5.5 at $2 and $10.

Sources