Claude Models Comparison: Haiku, Sonnet, Opus, Fable and How to Pick One (2026)
Anthropic currently serves four tiers of Claude models through the API: Haiku (cheapest, fastest), Sonnet (the everyday workhorse), Opus (the default for hard reasoning and coding agents), and Fable (the most capable, priced above Opus). Within each tier the current generation and one or two earlier generations stay callable. This guide compares them side by side so you can pick a model per task instead of per project.
Claude models comparison at a glance
The table below lists the models that are callable through the Messages API as of October 2026, with the exact model ID strings you pass in the model field. Prices are Anthropic's first-party API rates per million tokens, taken from Anthropic's pricing page; partner platforms such as Amazon Bedrock and Vertex AI bill separately.
|
Tier |
Model |
Model ID |
Context window |
Input / Output (per MTok) |
|---|---|---|---|---|
|
Fable |
Claude Fable 5.1 (current) |
|
1M |
$10.00 / $50.00 |
|
Fable |
Claude Fable 5 |
|
1M |
$10.00 / $50.00 |
|
Opus |
Claude Opus 5.5 (current) |
|
1M |
$4.00 / $20.00 |
|
Opus |
Claude Opus 5 |
|
1M |
$5.00 / $25.00 |
|
Opus |
Claude Opus 4.8 / 4.7 / 4.6 |
|
1M |
$5.00 / $25.00 |
|
Sonnet |
Claude Sonnet 5.5 (current) |
|
1M |
$2.00 / $10.00 |
|
Sonnet |
Claude Sonnet 5 |
|
1M |
$2.00 / $10.00 |
|
Sonnet |
Claude Sonnet 4.6 |
|
1M |
$3.00 / $15.00 |
|
Haiku |
Claude Haiku 5.5 (current) |
|
1M |
$0.10 / $0.50 |
|
Haiku |
Claude Haiku 4.5 |
|
200K |
$1.00 / $5.00 |
Two details worth noticing before you read further. First, the newest Opus is cheaper than the one before it: Claude Opus 5.5 costs less per token than Claude Opus 5, and Anthropic's documentation lists the same 1M context, 128K max output, and tokenizer for both. Second, the Haiku 5.5 rate above applies to prompts up to 100K tokens; according to Anthropic's pricing notes, prompts beyond that are billed at a higher rate ($0.50 / $2.50), so very long prompts on Haiku are not as cheap as the headline number suggests.
How the four tiers differ in positioning
Haiku is built for volume. Use it where you run the same prompt thousands of times a day and the task is narrow: classification, routing, extraction from short documents, moderation-style checks, or the first pass in a two-stage pipeline. It is also the natural choice for latency-sensitive interactive surfaces such as autocomplete or chat suggestions. Haiku 5.5 moved the tier to a 1M context window and adaptive thinking, so the "small model with a small window" assumption from Haiku 4.5 no longer holds.
Sonnet is the general-purpose tier. Anthropic positions Claude Sonnet 5.5 for everyday coding, agent, and enterprise work; at $2 / $10 it is what most teams run in production for chat assistants, document Q&A, summarization, and moderate-complexity tool use. If unsure, start here and measure.
Opus is the default for intelligence-sensitive work: multi-step coding agents, long autonomous tool-use loops, hard analysis, and anything where a wrong answer costs more than the tokens. Anthropic's SDK guidance treats Claude Opus 5.5 as the default model for new integrations, which is unusual for a top tier and is only possible because its price dropped below the previous Opus.
Fable sits above Opus. Claude Fable 5.1 is described by Anthropic as its most capable widely released model, intended for the most demanding reasoning and long-horizon agentic tasks. It costs 2.5x the Opus 5.5 input rate and has a few API differences (covered below), so most teams reserve it for the hardest slice of their workload rather than running it everywhere.
Context window and output limits
Every current-generation model, and every Opus and Sonnet model back to the 4.6 generation, offers a 1M-token context window with a 128K-token maximum output. The only model in the table with a smaller window is Claude Haiku 4.5 at 200K.
Two practical caveats from Anthropic's documentation:
- A 128K
max_tokensrequires streaming in the official SDKs; non-streaming requests at that size hit HTTP timeouts. - The 1M window is not a license to send 1M tokens every call. Input tokens dominate cost at these prices, so pair long context with prompt caching (cache reads are a fraction of the input rate: $0.20 per MTok on Opus 5.5 and Sonnet 5.5, $0.25 on Fable 5.1) and only put stable, reused content in the cached prefix.
Output speed and latency
Anthropic does not publish a single tokens-per-second figure per model, so this section is qualitative. The ordering is what you would expect: Haiku is the fastest to first token and the fastest to stream, Sonnet is next, Opus and Fable are the slowest because they think more before and during generation. Three things change that ordering in practice:
- Effort level. On current models, thinking is on by default and controlled with
output_config.effort(lowthroughmax). A Sonnet or Opus request atloweffort can return faster than the same request athigheffort by a wide margin. Anthropic's guidance is that lower effort on a newer model often matches a previous generation at high effort, so tune effort before you downgrade tiers. - Fast mode. Claude Opus 5.5 and Opus 5 offer a research-preview "fast mode" that runs the same model at up to 2.5x higher output tokens per second at a higher per-token price (per Anthropic's docs, $8 / $40 on Opus 5.5). It is Claude API only and has a separate rate limit.
- Request shape. Streaming shows tokens immediately on every tier; long non-streaming requests feel slow on every model.
Price gradient and what it means per task
Reading the table top to bottom, the input price steps roughly as 10 to 4 to 2 to 0.10 across Fable, Opus, Sonnet, and Haiku. Output follows the same shape at 5x the input rate. A few derived rules:
- Batch everything that is not interactive. Anthropic's Message Batches API processes requests asynchronously at 50% of the standard rate on every tier. Nightly classification, backfills, and evaluation runs belong there.
- Cache before you downgrade. If 70% of each request is a repeated system prompt or document, caching it on Opus can cost less than running Sonnet uncached.
- Judge cost per completed task, not per request. A cheaper model that needs more retries or more agent turns to finish is not cheaper. This is the single most common mistake in model selection.
Which Claude model for which developer scenario
|
Scenario |
First choice |
Fallback |
Why |
|---|---|---|---|
|
Coding agent (Claude Code, Codex-style loops) |
|
|
Long tool-use chains reward the higher tier; Opus 5.5 pricing makes it affordable as a default |
|
Hardest reasoning, long-horizon autonomous runs |
|
|
Top capability; keep a fallback for refusals (see below) |
|
Long-document analysis (contracts, logs, codebases) |
|
|
1M window on both; Sonnet keeps input cost manageable |
|
Bulk classification / extraction / routing |
|
|
Volume pricing; add Batches for another 50% off |
|
Low-latency chat, autocomplete, UI suggestions |
|
|
Fastest to first token |
|
LLM-as-judge in evals |
|
|
Consistent judgments without top-tier cost |
If you are calling Claude through the OpenAI-compatible protocol rather than the native SDK, the model IDs are the same strings; see our guide on using the OpenAI SDK with Claude for which parameters get mapped and which are ignored.
Writing the model ID in API calls
The model ID is the full string from the table, with no date suffix. Older documentation and training-era code often shows IDs like claude-3-5-sonnet-20241022; current models do not use that pattern, and appending a date to a current ID returns a 404. With the Python SDK:
import anthropic
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-5-5", # exact ID, no date suffix
max_tokens=16000,
output_config={"effort": "medium"},
messages=[{"role": "user", "content": "Summarize the attached incident report."}],
)
for block in response.content:
if block.type == "text":
print(block.text)If you are not sure a model is available to your account, query the Models API instead of guessing:
for m in client.models.list():
print(m.id, m.max_input_tokens, m.max_tokens)Each model object reports its context window (max_input_tokens) and output cap (max_tokens), a more reliable source than any blog table. For a first end-to-end call, see our how to use the Claude API walkthrough.
Generation differences that break code when you switch models
Choosing a tier is only half of model selection; the other half is knowing which request parameters change between generations. From Anthropic's migration notes:
- Thinking configuration. Haiku 4.5 still uses
thinking: {type: "enabled", budget_tokens: N}. Every current-generation model uses adaptive thinking ({type: "adaptive"}), and sendingbudget_tokensto Opus 5.5, Sonnet 5.5, or Fable 5.1 returns a 400. On Opus 5.5 and Fable 5.1 thinking cannot be disabled at all; on Sonnet 5.5 the way to turn it off isthinking: {type: "between_tools"}at efforthighor below. - Default effort. Opus 5.5 and Haiku 5.5 default to
medium; Sonnet 5.5 and Fable 5.1 default tohigh. Set it explicitly so a model swap does not silently change quality or latency. - Forced tool choice.
tool_choice: {type: "any"}and{type: "tool", name: ...}return a 400 on Opus 5.5, Sonnet 5.5, and Fable 5.1. Useautoplusstrict: trueon the tool, or structured outputs, when the forced call only existed to get JSON back. - Assistant prefill. Prefilling the last assistant turn is rejected across the 4.6+ family. Use
output_config.formator system-prompt instructions instead. - Thinking blocks are model-bound. Blocks produced by one model are dropped (unbilled) when the conversation continues on another, so a mid-conversation fallback loses prior reasoning rather than erroring.
Downgrade and fallback strategy
A model choice that only works while the top model is healthy is incomplete. Three mechanisms, from most to least automatic:
- Server-side refusal fallback. On Fable 5.1, Opus 5.5, Opus 5, and Sonnet 5.5, Anthropic's safety classifiers may return
stop_reason: "refusal"with HTTP 200. The API offers an opt-infallbacksparameter (beta) that re-runs the same request on a fallback model inside the same call, routed by refusal category. Always checkstop_reasonbefore readingcontent. - Overload and rate-limit fallback. A 529 overloaded or 429 rate-limit response is a reason to retry with backoff first, then to step down one tier for that request. Keep the step-down list short and ordered:
claude-opus-5-5toclaude-sonnet-5-5toclaude-haiku-5-5. Our guide on Claude API error 529 overloaded covers retry timing. - Per-task routing. Rather than one global model, define the model per task type in configuration and give each route its own fallback. A minimal pattern:
import anthropic
ROUTE = {
"agent": ["claude-opus-5-5", "claude-sonnet-5-5"],
"classify": ["claude-haiku-5-5", "claude-sonnet-5-5"],
}
def ask(route: str, messages: list) -> str:
client = anthropic.Anthropic()
last = None
for model in ROUTE[route]:
try:
r = client.messages.create(model=model, max_tokens=4096, messages=messages)
if r.stop_reason == "refusal":
last = r
continue
return next(b.text for b in r.content if b.type == "text")
except (anthropic.RateLimitError, anthropic.InternalServerError) as e:
last = e
raise RuntimeError(f"all models failed for route {route}: {last}")Keep the SDK's built-in retries (two by default, with backoff) on; the loop above only handles the case where retries are exhausted.
Summary
Start with Sonnet 5.5 for general work, move intelligence-sensitive and agentic routes to Opus 5.5, send volume to Haiku 5.5 plus Batches, and reserve Fable 5.1 for the hardest slice. Tune effort before you change tiers, cache before you downgrade, and write the model ID exactly as Anthropic publishes it. ROIBest AI exposes these Claude models through an OpenAI-compatible endpoint, so the same model ID strings work whether you call the native SDK or an OpenAI-protocol client.
FAQ
Which Claude model is the best default for a coding agent?
Claude Opus 5.5 (claude-opus-5-5). Anthropic's SDK guidance treats it as the default for new integrations, and at $4 / $20 per MTok it is cheaper than the previous Opus while keeping the 1M context and 128K output.
Is Claude Sonnet 5.5 cheaper than Sonnet 5?
They are priced the same ($2 / $10 per MTok) according to Anthropic's pricing page. Sonnet 5.5 is the newer generation with recalibrated effort levels, so it is the better pick unless you need Sonnet 5 specifically.
Do all Claude models support a 1M-token context window?
All current-generation models do, as do the Opus and Sonnet models back to 4.6. The exception in the callable list is Claude Haiku 4.5, which has a 200K window; its successor Haiku 5.5 moved to 1M.
Can I use the same model ID with an OpenAI-compatible client?
Yes. The model ID is a plain string such as claude-sonnet-5-5 in both the native Anthropic SDK and OpenAI-protocol clients; what differs is which request parameters get mapped, not the model name.