Claude API Model Selection Guide: Haiku vs Opus
If you're building on the Claude API, the first real decision you'll make isn't about prompts or tools — it's which model to call. Anthropic ships multiple model tiers (commonly referred to by their Haiku, Sonnet, and Opus lines), and picking the wrong one either burns money on tasks that didn't need it, or produces mediocre output on tasks that did.
The short answer: use Haiku for high-volume, low-complexity tasks (classification, extraction, short replies, moderation), use Sonnet as the default workhorse for most product features (chat, summarization, coding assistance, agents), and reserve Opus for tasks that genuinely require deep reasoning (multi-step analysis, complex code generation, nuanced writing, hard math/logic). Below is how to actually make that call for your specific workload.
The three tiers, in practical terms
Haiku — fast and cheap
Haiku is optimized for speed and cost, not depth. It's the right choice when:
- You're doing simple classification (spam/not spam, intent routing, sentiment)
- You need structured extraction from short, clean inputs (pull a name and date from a form)
- You're running the same prompt thousands of times a day and margins matter
- Latency is user-facing and needs to feel instant (autocomplete, live suggestions)
Haiku will still write coherent prose and follow instructions reasonably well, but it makes more reasoning mistakes on multi-step problems and struggles with long, ambiguous instructions.
Sonnet — the default
Sonnet is the model most teams should reach for first. It handles:
- Customer support chat and general Q&A
- Summarization of medium-length documents
- Code generation and review for typical application code
- Agentic tool-use flows where the model needs to plan a few steps ahead
It's slower and more expensive than Haiku, but the quality jump is significant enough that for anything customer-facing, Sonnet is usually the safer default. Most production apps should start here and only move to Haiku or Opus after measuring actual output quality against real requests.
Opus — maximum capability
Opus is the model to reach for when correctness matters more than cost or speed:
- Complex, multi-step reasoning chains
- Legal, medical, or financial analysis where errors are expensive
- Large-scale code refactors or architecture decisions
- Long-form writing that needs nuance and consistency across thousands of words
Opus costs meaningfully more per token and responds slower. Using it for simple lookups or short replies is a common and avoidable cost mistake.
How to actually choose: a decision process
Don't guess — test. A practical workflow:
- Write down the task's failure cost. If a wrong answer just means a slightly worse chat reply, that's low. If it means a bad legal summary shipped to a customer, that's high.
- Start with Sonnet as your baseline and run 20–50 real (not synthetic) examples through it.
- Try Haiku on the same set. If quality holds and the task is high-volume, downgrade — the cost savings compound fast at scale.
- Only escalate to Opus if Sonnet's failure rate on your actual data is unacceptable, not because the task "sounds hard."
- Re-test after prompt changes. A better system prompt often closes the gap between Sonnet and Opus more than switching models does. See our guide on system prompts for prompt patterns that reduce the need for a bigger model.
A concrete example: if you're building a support bot that classifies incoming tickets into five categories, don't default to Opus because it's "the best model." Run the classification through Haiku first — for a bounded, well-defined task like this, Haiku will likely hit 95%+ accuracy at a fraction of the cost, and you can spend the savings on a bigger model for the actual response generation step.
Mixing models in one pipeline
The most cost-efficient production systems don't pick one model — they route between tiers based on the step:
// Example: tiered pipeline
async function handleTicket(ticketText) {
// Step 1: cheap classification with Haiku
const category = await callModel("haiku", classifyPrompt(ticketText));
// Step 2: response generation with Sonnet
const draft = await callModel("sonnet", replyPrompt(ticketText, category));
// Step 3: escalate only flagged/complex cases to Opus
if (category === "legal" || category === "escalation") {
return await callModel("opus", deepAnalysisPrompt(ticketText, draft));
}
return draft;
}
This pattern — cheap model for triage, mid-tier for the bulk of the work, top-tier for the hard 5% — is how most teams keep Claude API costs predictable while still handling edge cases well.
If you're exposing this pipeline as a product feature, SubToAPI turns your existing Claude access into application API keys (sub_live_...) so each service or customer can call the right model tier independently, with usage metadata per key so you can see exactly which model tier is driving cost. See the quickstart or the messages docs for how requests map to model selection, and pricing for plan details if you're issuing keys to a team.
Watch for these mistakes
- Defaulting to the biggest model "to be safe." This is the single most common source of avoidable Claude API spend. Test smaller models first.
- Never re-testing after Anthropic updates a model. Model behavior and pricing shift over time; a task that needed Opus a year ago may run fine on Sonnet today.
- Using Haiku for open-ended reasoning tasks. It's fast, but it will confidently produce shallow multi-step reasoning — fine for extraction, risky for judgment calls.
- Ignoring latency requirements when picking a model. Opus's extra reasoning time can break a real-time UX even if the output quality is better.
- Not measuring on real data. Benchmarks and vendor comparisons are a starting point, not a substitute for testing your actual prompts against your actual inputs.
Wrapping up
There's no universal "best" Claude model — only the right model for a given task's complexity, volume, and error tolerance. Start with Sonnet, push simple high-volume work down to Haiku, and reserve Opus for the subset of requests where deeper reasoning actually changes the outcome. Building a tiered pipeline like this is straightforward once you have clean API access with per-key usage tracking — check the tools docs if your pipeline also needs function calling across model tiers.
questions
Is Opus always more accurate than Sonnet? Not always in a way that matters. For well-defined tasks, Sonnet often matches Opus; the gap widens on genuinely complex, multi-step, or ambiguous problems.
Can I switch models per request without restructuring my app? Yes — model selection is just a parameter in your API call, so you can route different requests (or pipeline steps) to different tiers without changing your integration.
How do I know if Haiku is "good enough" for my task? Run a representative sample of real inputs through Haiku and Sonnet side by side, compare error rates against your actual acceptance threshold, and only upgrade the steps that fail.