Lesson 71.5 · 5 of 6 · 4 min read · Reviewed 24 Nov 2026
Worked example: choosing between model tiers by cost
By the end, you can
- Choose a Claude model by cost and quality for each task.
- Use the models and pricing pages instead of memorised numbers.
The family
| Model | Broad role |
|---|---|
| Haiku | Smallest and fastest; high-volume, simple tasks, sub-agents, routing |
| Sonnet | Strong all-rounder; most production chat, coding and agent work |
| Opus | Larger model for harder reasoning and long, complex tasks |
| Fable | Another Claude model family; see the models page for what it is suited to |
This table is deliberately broad. Capabilities, context windowsContext window: The maximum number of tokens a model can consider at once, counting the input and the output it generates., prices and the line-up change, so the models overview and pricing pages are the source of truth. Check them when planning, and record the date you checked.
Choosing by task
- Write the eval firstEval-driven development: Writing the evaluation first, then iterating on prompts and code until it passes. (Part 3).
- Run it on a smaller model and a larger one.
- Compare quality, latency and cost per taskCost per task: The full cost of completing one unit of user value, such as a resolved ticket, including retries and all calls. (71.1).
- Pick the cheapest model that meets the bar, per task, not per app.
A single app often uses several: a small model to route and label, a mid-size model for most replies, and a larger model for the hardest cases.
Other cost settings
- Extended thinkingExtended thinking: A mode in which the model reasons step by step in thinking blocks before giving its final answer. improves hard reasoning but adds output tokensOutput tokens: The tokens the model generates in its reply, including any tool calls and thinking.. Turn it on where evalsEval: A repeatable test that measures how well an AI system performs on a set of cases with defined success criteria. show it helps.
- max_tokensmax_tokens: The required request field that caps how many tokens the model may generate in its reply. caps output per call.
- Prompt cachingPrompt caching: Reusing the processed form of a repeated prompt prefix across requests, which cuts cost and latency. and batches change the effective price a lot; include them in comparisons.
Key points
- Claude models come in tiers: Haiku is the smallest and fastest; Sonnet balances capability and cost; Opus and Fable are the larger, more capable models.
- Pick by evaluation: start with the cheapest model that might work, measure, and move up only where it fails.
- Prices and model lists change; read the current models and pricing pages rather than relying on remembered numbers.
Choose a Claude model per task
Pick the cheapest Claude model that meets your quality bar for each task, using evals and the current pricing page.
You will have: A per-task model choice table with eval scores, latency, tokens per task, the date you checked pricing, and the chosen exact model id.
Steps
- List three tasks in one app, for example routing, everyday replies and a hard analysis step, and write a quality bar for each.
- Build a small eval set per task (20 or more cases) and a grading rule.
- Run each eval on a smaller and a larger model with the API; keep your key in the ANTHROPIC_API_KEY environment variable, never in code.
- Record pass rate, p95 latency and input and output tokens per task from the usage fields.
- Look up current prices on the pricing page, write down the date, and work out cost per task.
- Choose the cheapest model that meets each bar and write the exact ids into your versioned config.
Done when
- Every task has a chosen model id with the eval score that justifies it.
- The table records the date the pricing page was checked.
- At least one task uses a different model from the others, or you wrote down why not.
Docs: Models overview (Claude docs) · Pricing (Claude docs) · Define success criteria and build evaluations (Claude docs)