Claude Models Compared: Opus, Sonnet, Haiku Pricing
Why Claude models pricing matters
Claude models pricing is not just about picking the cheapest option. The wrong model on a hot loop can cost ten times more than the right one for the same task quality. The right model on a high-volume background task can cost ninety percent less than the default. Most production teams either over-pay by routing everything to the top-tier model or accept lower quality by routing everything to the cheapest, when the actual answer is per-task selection.
This guide compares Claude models pricing across Opus, Sonnet, and Haiku, shows the cost-per-task math for typical developer workloads, and lays out the routing rules that consistently cut API bills without hurting quality. If you want the broader Claude pricing picture (Pro, Max, Team, Enterprise plans), our Claude pricing explained guide covers the subscription side, and Claude vs ChatGPT pricing sets these per-token rates against OpenAI's.
The three-model lineup
Claude's API is a three-tier ladder, all priced per token rather than per call. Anthropic publishes current rates at console.anthropic.com. They shift with each model generation but the structural pattern has been stable since Claude 3.
Opus is the top of the lineup. It costs the most per token but delivers the highest reasoning capability. Use Opus when the per-call cost is small relative to the value of getting the answer right.
Sonnet is the middle tier. Priced for production, it is the default for most developer workloads. Sonnet is roughly one-third the cost of Opus per token while retaining most of the quality on common tasks.
Haiku is the cheapest and fastest. Built for high-volume, latency-sensitive tasks. Haiku costs roughly a tenth of Sonnet per token and runs noticeably faster, but with less depth on complex reasoning.
The pricing ratio across the lineup has stayed roughly 1:3:10 (Haiku:Sonnet:Opus) for years. Anthropic adjusts the absolute numbers but the relative scale is durable.
Reading the per-token price tag
Every Claude API model has two prices: input tokens (what you send) and output tokens (what the model generates). Output tokens are typically four to five times more expensive than input. This matters because it changes the cost-optimisation game depending on the workload.
For workloads where you send a long context and get a short answer (classification, extraction, lookup), input cost dominates and prompt caching is the highest-leverage optimisation. For workloads where you send a short prompt and get a long generation (code generation, content writing), output cost dominates and model choice matters more.
A typical Claude Code session sits in the middle: medium input (the file context plus the user prompt) and medium output (the diff or the new file). Cost per turn ranges from a fraction of a cent on Haiku to several cents on Opus.
Cost-per-task examples
Real numbers from common developer workloads, using Sonnet as the baseline:
Code review of a 1,000-line file
- Input: ~5K tokens (file plus instructions)
- Output: ~500 tokens (review summary)
- Sonnet: roughly 1.5 cents per review
- Opus: roughly 4.5 cents
- Haiku: roughly 0.15 cents
Refactor across 5 files in a Claude Code session
- Input: ~15K tokens (files plus context)
- Output: ~3K tokens (diffs)
- Sonnet: roughly 5-6 cents
- Opus: roughly 15-18 cents
- Haiku: too small for complex multi-file work, quality drops noticeably
Classifying 1,000 customer support tickets
- Input: 100 tokens × 1,000 = 100K tokens
- Output: 20 tokens × 1,000 = 20K tokens
- Sonnet: roughly 30 cents per batch
- Opus: roughly 90 cents
- Haiku: roughly 3 cents
The classification example shows the routing leverage clearly: Haiku does this task at one-tenth the cost of Sonnet and at the same quality, because the task is easy. Opus would be wasted spend.
When to use Opus
Opus pays off when the cost of a wrong answer is much higher than the cost of the call. Three workloads where Opus is the right choice:
Architectural decisions and design reviews. A bad architectural call can cost weeks. A few extra cents per review is rounding error compared to the engineering time saved.
Final-pass content review. Editing a near-final blog post or report. Quality matters more than throughput, you are running it once.
Edge-case debugging. When the bug is subtle and Sonnet has already failed twice, Opus often catches what Sonnet missed. The hour you do not waste reproducing the bug is worth the price difference.
Where Opus is wasted: classification, extraction, simple code completion, anything inside a hot loop. The pattern to avoid is "we use Opus by default for quality." Quality at scale is built by structuring the task well, not by upgrading the model.
When to use Sonnet
Sonnet is the default for production code workloads. Three signals that Sonnet is the right choice:
Multi-step reasoning is required. Tasks that need 2-5 reasoning steps benefit from Sonnet's depth. Haiku tends to skip steps; Opus is overkill.
Output length is moderate. Generating diffs, writing functions, summarising files. Sonnet's price-quality balance is best here.
The task happens dozens of times per day, not thousands. Sonnet is affordable enough for daily developer work. At thousands of calls per minute, you start optimising toward Haiku for the simple ones.
Sonnet is the right choice for almost every Claude Code interactive session. Switching to Haiku for code generation usually shows up in regression bugs within a week.
When to use Haiku
Haiku owns high-volume, latency-sensitive workloads. Five examples:
Quality classification on the way through your pipeline. Spam filtering, sentiment tagging, content moderation. Haiku does these at one-tenth the cost.
Routing decisions inside an agent. "Should this task go to subagent A or B?" is a one-token answer that does not need Opus.
Fast autocomplete or suggestion generation. Where users feel the latency. Haiku's speed advantage is the feature.
Audit hooks and quality gates. Background checks running after every action. They need to be cheap or they kill your bill.
Batch processing of structured data. Extraction, transformation, simple summarisation across many records.
Haiku struggles on tasks that need genuinely creative or multi-step reasoning. It is fine for narrowly-scoped, repeatable work and starts to break down on novel ones.
The routing rule that cuts bills in half
The single most effective Claude API optimisation is per-task model routing. The pattern:
- Define each task in your system explicitly (classify, extract, generate, review, debug)
- Map each task to its smallest sufficient model
- Default to Sonnet only where you cannot confidently say a smaller model works
- Reserve Opus for the small set of tasks where quality wins clearly justify the price
A typical agentic system has 5-10 distinct task types. Routing them properly drops the API bill 40-60 percent versus a Sonnet-everywhere baseline, with no quality regression on any user-visible output. Model routing is one lever among several; Claude Code cost optimization covers the context discipline, caching, and re-read habits that compound with it.
The reason most teams overspend is not that they do not know this pattern. They have not formalised their task types into named subagents with explicit model assignments. When every task is "send this to Claude," you cannot route. When every task has a name and a definition, you can.
This is exactly the architecture Claudify ships out of the box: each agent has its own model assignment, each hook has a budget, and the routing decisions live in code rather than in someone's head.
Prompt caching and batch processing
Two API features that change the pricing math significantly:
Prompt caching lets you mark a portion of your prompt as cached. Subsequent calls within a five-minute window pay 10 percent of the input cost on the cached portion. For workloads with repeated context (CLAUDE.md, system prompts, document references), this is up to 90 percent off input costs. Configure it carefully, caching the wrong portion does nothing.
Batch processing trades latency for cost. Submit jobs to the batch API, get results within 24 hours, pay 50 percent of standard rates. For non-interactive workloads (overnight reports, bulk classification, training data prep), batch is the right choice.
Both features are documented at console.anthropic.com and are the difference between a sustainable production budget and one that creeps upward every month.
Hidden cost: input bloat
The single biggest source of unexpected bills is not which model you picked, it is how much you sent into the input. Two patterns to watch for:
CLAUDE.md getting injected on every call. A 10K-token CLAUDE.md gets read into every Claude Code session. Multiply by 100 sessions per day and that is 1M tokens of input cost just for the configuration file. Trim it.
Stale conversation history. Claude Code retains chat history within a session. After 50 turns, you may be sending 100K tokens of past context with every new prompt. Memory systems mitigate this; ignoring it does not.
Cost optimisation that helps every model tier:
| Pattern | Savings |
|---|---|
| Trim CLAUDE.md to under 2K tokens | 30-40% input reduction per session |
| Use prompt caching on system prompts | 70-90% input cost on cached portion |
| Use memory systems for project state | 50% input reduction over conversation history |
| Switch background classification to Haiku | 90% cost on those tasks |
| Batch process anything non-interactive | 50% rate on batched calls |
A single Claudify install hits all five of these structurally. That is why teams typically see 40-60 percent token consumption drops in the first week after switching.
Quick reference
| Task type | Model | Why |
|---|---|---|
| Architectural review | Opus | Quality matters more than cost |
| Code generation in IDE | Sonnet | Best price-quality balance |
| Multi-step refactor | Sonnet | Needs reasoning, output dominates cost |
| Classification | Haiku | One-tenth the price, same accuracy |
| Routing decisions inside agents | Haiku | Latency-sensitive, simple |
| Quality audits and hooks | Haiku | Background work, runs constantly |
| Final-pass content review | Opus | Run once, quality matters |
| Bulk extraction | Haiku + batch | Structurally cheap |
Next steps
The model is one decision in a longer cost equation. Per-call routing matters. Context discipline matters more. Architecture matters most.
Get Claudify. The Claude operating system that ships with per-agent model routing, structured memory, and audit hooks built in. Same Claude, half the bill.
More like this
Ready to upgrade your Claude Code setup?
Get Claudify