Opus, Sonnet or Haiku? Choosing a Claude Model by the Job

Tier names persist across generations; the version is what sets the price.

Tier names persist across generations; the version is what sets the price.

Anthropic ships Claude in tiers — Haiku, Sonnet, Opus, and Fable above them — and each generation keeps the names while changing the capability and price behind them. That makes "which Claude model should I use?" a question about jobs, not leaderboards. Here is a practical way to decide.

Tiers are not versions

"Opus" or "Sonnet" on its own is ambiguous. The API needs a concrete id such as claude-sonnet-5 or claude-opus-4-8, and two versions of the same tier can differ in price and context window. Always write the full id in code, and check which ids your endpoint actually serves with GET /v1/models.

The short version

  • Haiku — classification, extraction, routing, summaries, subagent scouting. Fast, cheap, not for the main edit loop.

  • Sonnet — the default for coding and agents. Strong enough that most teams rarely need more.

  • Opus — architecture decisions, hard debugging, long autonomous runs where a wrong step is expensive.

  • Fable — the top line, for the hardest long-horizon work when cost matters less than getting it right first time.

Cost per task beats cost per token

Per-token prices mislead. A cheaper model that needs three attempts costs more than a stronger one that succeeds in one, and output tokens usually cost several times more than input tokens. The useful metric is cost per completed task on your own work. Measure it on a handful of real tickets before standardising on a model.

A routing pattern that works

  1. Default every request to Sonnet.

  1. Send classification, summarisation and scouting to Haiku.

  1. Escalate to Opus only on the specific prompts where Sonnet fails your evaluation.

  1. Revisit the split when a new generation ships — tier boundaries move.

In Claude Code the same idea is built in: the agent maps tiers to model ids, and you can override the mapping with ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL. Switching mid-session is /model.

Context windows

Newer generations carry 1M-token windows natively; older ones reach it through a separate variant. A large window is free until you fill it — then every turn resends it. Big context is a tool for whole-repository questions, not a reason to stop compacting.

Thinking and effort

The larger models can reason before they answer. Extended-thinking variants and effort controls let you trade latency and cost for depth inside the same model family. For a reasoning-heavy but latency-sensitive task, a strong model at lower effort is often a better fit than a smaller model with a longer prompt. For simple lookups, thinking is wasted tokens.

Which model for Claude Code specifically

Claude Code makes hundreds of calls in a working session, so the default tier matters more than the flagship. Keep the main loop on Sonnet, point the Haiku tier at the cheapest current Haiku (it handles the agent's small internal tasks), and reserve Opus or Fable for planning a large change or chasing a bug that Sonnet has failed on twice. The /model command makes the switch a one-line decision rather than a configuration change.

Test before you commit

Before standardising on a model, send the same three or four real tasks to each candidate and compare the results and the token counts. A minimal request looks like this:

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model": "claude-sonnet-5", "max_tokens": 1024,
       "messages": [{"role": "user", "content": "Refactor this function..."}]}'

The usage block in the response reports input and output tokens, which is all you need to compute cost per task. Swap the host for any Anthropic-compatible endpoint and the request is unchanged.

A model catalogue listing every Claude id with its list and effective price.

A model catalogue listing every Claude id with its list and effective price.

For a current list of ids with prices side by side, this catalogue of Claude models and prices is kept up to date. If you are just starting, the first step is the same whichever tier you choose: get a Claude API key from the Anthropic Console or from a gateway, and test it with a one-line request before building on it.

readers loved this