SSD Nodes Learn
Guides Matt ConnorBy Matt Connor

Which Claude model should I use? Cost guide

Opus 4.8, Sonnet 5 or Haiku 4.5? The July 2026 rates per model, a worked cost comparison on 100,000 jobs, and the settings that move a bill most.

Which Claude model should I use?

The short answer to which Claude model you should use: start with Claude Opus 4.8, and move away from it only for a reason you can name. Anthropic's guidance is the same. "If you're unsure which model to use, start with Claude Opus 4.8 for complex agentic coding and enterprise work." Move down to Claude Sonnet 5 when the task is well specified and you run it many times a day. Move down again to Claude Haiku 4.5 for mechanical, high-volume work where you already know what a correct answer looks like. Claude Fable 5 sits above all of them, for long-running agents.

The choice has a price attached. These are the rates on the Claude API (application programming interface) as of 23 July 2026, per million tokens, which the docs write as MTok.

  • Claude Fable 5 (claude-fable-5): $10 / MTok in, $50 / MTok out. 1M context.
  • Claude Opus 4.8 (claude-opus-4-8): $5 in, $25 out. 1M context.
  • Claude Opus 4.7 (claude-opus-4-7): $5 in, $25 out. 1M context.
  • Claude Sonnet 5 (claude-sonnet-5): $2 in, $10 out on introductory pricing through 31 August 2026. The standard $3 in, $15 out takes effect on 1 September 2026. 1M context.
  • Claude Haiku 4.5 (claude-haiku-4-5): $1 in, $5 out. 200K context.

Those identifiers are complete as written. Nothing gets appended to them.

Size itself carries no surcharge on the 1M-token models: "A 900k-token request is billed at the same per-token rate as a 9k-token request."

What each model is actually for

Anthropic describes the lineup in one line per model, and those lines guide better than any leaderboard.

  • Claude Fable 5: "Next-generation intelligence for long-running agents." Rated the slowest of the four on latency.
  • Claude Opus 4.8: "For complex agentic coding and enterprise work." Moderate latency.
  • Claude Sonnet 5: "The best combination of speed and intelligence." Fast.
  • Claude Haiku 4.5: "The fastest model with near-frontier intelligence."

Haiku 4.5 also carries limits that decide job fit before price does. Its context window is 200K tokens instead of 1M, so a large repository or a long agent transcript will not fit. Its maximum output on the synchronous Messages API is 64K tokens against 128K for the others, and its reliable knowledge cutoff is February 2025, where the other three sit at January 2026.

What does the choice cost me on a real workload?

Every model in the lineup prices output at five times its input rate. Opus 4.8 is $5 in and $25 out. Haiku 4.5 is $1 in and $5 out. The ratio holds all the way down the range, so the model you pick matters most on work that generates a lot of output.

Agentic work is that kind of work, because thinking tokens are billed as output tokens and count toward max_tokens even when the text never reaches you. On Fable 5, Opus 4.8, Opus 4.7 and Sonnet 5 the reasoning summary is omitted by default, so the thinking field comes back empty. The billing is unchanged: "Either way the block is billed the same and passed back the same in multi-turn conversations." What actually fills a Claude token bill takes that meter apart in full.

Whether thinking runs at all differs between the models you are comparing, which will wreck a cost test if you miss it. On Sonnet 5 and Fable 5 thinking is already on and needs no configuration. On Opus 4.8 and Opus 4.7 it is off until you set thinking: {type: "adaptive"} in the request. Match the configuration on both sides before you read anything into the numbers.

Why the cheapest model can be the most expensive

Take one self-contained coding task. The request carries 60,000 tokens of context, and the model produces 8,000 tokens of output including thinking. No caching, so the arithmetic stays visible.

On Opus 4.8: 0.06 MTok of input at $5 is $0.30, and 0.008 MTok of output at $25 is $0.20. The attempt costs $0.50. On Haiku 4.5 the same attempt is $0.06 plus $0.04, so $0.10.

Haiku is five times cheaper per attempt, which looks like a lot of room to spare until you follow what a failed attempt does. You read the wrong answer, which costs your time. You re-send it as context on the retry, so each attempt is bigger than the last. And when the third attempt still misses, you escalate anyway: $0.30 of Haiku plus $0.50 of Opus is $0.80, or 60% more than running Opus once.

So the deciding question is how cheaply you can check the answer. When a wrong answer is obvious in one second, the small model is a bargain. When spotting one means reading a diff carefully, the small model costs you time that never appears on the invoice.

Where a smaller model wins outright

Haiku 4.5 is the right answer in these cases:

  • Mechanical subagent work. A subagent that renames files or collects search output needs no frontier reasoning. That is the standard pattern once you build an AI agent with Claude and give it helpers.
  • Log triage. Deciding whether a line is noise or worth a human's attention is a narrow judgement with an obvious failure mode.
  • Classification against a fixed label set. The output is short and accuracy is measurable on a sample.
  • High-volume production calls. At 100,000 runs a day the per-token gap stops being a rounding error. That is the usual shape of AI workflows wired into n8n.
  • Anything where response speed matters to the user. Haiku 4.5 is rated the fastest model in the lineup.

One limit belongs to Haiku specifically. Its minimum cacheable prompt is 4,096 tokens, against 1,024 on Opus 4.8 and Sonnet 5, and below that minimum "any requests to cache fewer than this number of tokens will be processed without caching, and no error is returned". A 1,500-token instruction block that caches on Sonnet 5 silently does not cache on Haiku 4.5. The tell is cache_creation_input_tokens and cache_read_input_tokens both sitting at zero, which keeping an always-on agent's costs down covers alongside the other ways to lose a cache.

The levers that change the answer

Each of these moves a bill further than the model name does.

Effort. output_config.effort controls how much work the model does before it answers. The levels are low, medium, high, xhigh and max, and high is the default: "Setting effort to high produces exactly the same behavior as omitting the effort parameter entirely." It nests inside output_config rather than sitting at the top level of the request:

response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=4096,
    output_config={"effort": "medium"},
    messages=messages,
)

Effort touches every token in the response: "It can affect all token spend including tool calls. For example, lower effort would mean Claude makes fewer tool calls." That compounds on an agentic loop. It is not a token cap: "Effort is a behavioral signal, not a strict token budget." Anthropic publishes no cost multiplier per level and tells you to test your own use case, so a Sonnet 5 run at high against an Opus 4.8 run at low is a real comparison you can run this afternoon. Haiku 4.5 is absent from the list of models that support effort.

Prompt caching. A cache read costs 0.1x the base input rate, and the number that decides a model choice is what that does across tiers. A cache hit on Opus 4.8 costs $0.50 / MTok, and uncached input on Haiku 4.5 costs $1 / MTok, so a well-cached Opus prefix is cheaper per input token than a cold Haiku prompt. Session hygiene beats model choice on any workload that re-sends a large stable prefix.

Batches. If nothing is waiting on the answer, the Message Batches API runs the same models with "a 50% discount on both input and output tokens". It halves every row of the comparison below, and it works across tiers: a batched Opus 4.8 job costs less than a synchronous Sonnet 5 job at the standard price from 1 September 2026, trading latency for capability at the same money.

One worked cost comparison

The workload: classify 100,000 support emails, one call each, 2,000 input tokens and 300 output tokens per call. That is 200 MTok of input and 30 MTok of output.

  • Haiku 4.5: 200 x $1 = $200 in, 30 x $5 = $150 out. Total $350.
  • Sonnet 5, introductory rate: 200 x $2 = $400 in, 30 x $10 = $300 out. Total $700.
  • Sonnet 5, from 1 September 2026: 200 x $3 = $600 in, 30 x $15 = $450 out. Total $1,050.
  • Opus 4.8: 200 x $5 = $1,000 in, 30 x $25 = $750 out. Total $1,750.

Swap four numbers to redo it with tomorrow's prices. The adjustments below move the result further than the model name did:

  • Batching halves every line: $175, $350, $525 and $875. Nothing waits on a nightly classification run, so there is no reason to skip it.
  • Caching the shared prefix. Say 1,200 of the 2,000 input tokens are the same instruction block every time. On Sonnet 5 at the introductory rate those cost $0.20 / MTok as cache hits instead of $2 / MTok, so 120 MTok costs $24 rather than $240. Add 80 MTok of fresh input at $2, which is $160, plus $300 of output, and Sonnet 5 lands near $484 instead of $700. The same trick does nothing on Haiku 4.5, because 1,200 tokens is under its 4,096-token minimum.
  • Retries. Suppose you reject Haiku's answer on 8% of the emails and re-run those on Opus 4.8. Add 0.08 x $1,750 = $140 to the $350, giving $490. Measure your own rejection rate rather than borrowing mine.
  • Tool definitions, if the job uses them. The system prompt they generate is 290 tokens on Opus 4.8 with tool_choice set to auto, 354 on Sonnet 5 and 496 on Haiku 4.5. The cheapest model carries the largest fixed overhead.

Haiku with an escalation path at $490 and cached Sonnet 5 at $484 cost the same, and one of them does the job in a single pass. The model was never the whole question.

Does switching models mid-session save money?

Less often than the sticker prices suggest, because the saving is per token and what you put at risk is a whole cached prefix.

Anthropic documents what invalidates a cache. Prefixes are built in the order tools, then system, then messages, and "Changes at each level invalidate that level and all subsequent levels." Two request settings are on that list too: "The thinking configuration and the resolved effort level are rendered into the prompt itself, so changing any of them starts a new cache prefix." On effort the docs go further: "vary effort across workloads rather than within a conversation that relies on cache hits".

The model is not on that documented list, so do not assume it either way. Read cache_read_input_tokens on the first request after a switch and let the number answer. On a 150,000-token Opus 4.8 prefix a cache read costs about $0.08 and a fresh write about $0.94, which is more than several turns of the per-token gap you were chasing.

So change these things between tasks, not inside one. In Claude Code that means /clear first, when the cache is being discarded anyway, then /model or /effort.

How to test the answer on your own workload

Do not size a prompt with a count taken from a different model. The token-counting endpoint is free to use and counts with the tokenizer of whichever model you name, so name the one you plan to call. Opus 4.7 and later, Fable 5 and Sonnet 5 use a newer tokenizer that "produces approximately 30% more tokens for the same text", so a budget measured on an older model reads low on a newer one at an unchanged per-token rate.

Then read what came back. input_tokens is only the uncached remainder, so the true prompt size is that field plus cache_creation_input_tokens plus cache_read_input_tokens. A first Claude API app on a VPS is the smallest honest place to run that measurement, and which Claude plan fits your usage is the separate decision about whether you pay per token at all.

FAQ

Which Claude model is best for coding?

Claude Opus 4.8 is the documented starting point for complex agentic coding, at $5 per million input tokens and $25 per million output as of July 2026. Claude Sonnet 5 is positioned as the best combination of speed and intelligence, and at $2 / $10 through 31 August 2026 it costs less than half as much. Run the same task on both, hold the thinking configuration constant, and compare total token spend from response.usage.

Is Claude Haiku 4.5 cheap enough to replace Sonnet 5?

Per token, easily: $1 / $5 against $2 / $10 for Sonnet 5 on introductory pricing, or $3 / $15 from 1 September 2026. The limits decide it. Haiku 4.5 has a 200K token context window rather than 1M, a 64K maximum output on the synchronous Messages API, a February 2025 reliable knowledge cutoff, no output_config.effort support, and a 4,096-token minimum cacheable prompt that quietly disables caching on short system prompts.

Does switching to a cheaper Claude model mid-session save money?

Less often than it looks. Anthropic documents the cache invalidators as changes to the tools, system or messages prefix, changes to the thinking configuration, and changes to output_config.effort. What a model switch does to an existing cache is not documented, so treat it as unknown and read cache_read_input_tokens on the first request afterwards. The stake is worth knowing: on a 150,000-token Opus 4.8 prefix a cache read costs about $0.08 and a fresh write about $0.94, which outweighs several turns of the per-token saving. Switch between tasks, after /clear in Claude Code, when the cache is being thrown away regardless.

What does output_config.effort do to my bill?

It changes how many tokens the model spends across text, tool calls and thinking. Lower effort makes fewer tool calls, which compounds on agentic loops because every tool result is re-sent on later turns. The levels are low, medium, high, xhigh and max, with high as the default. Anthropic publishes no cost multiplier per level, calling effort a behavioural signal rather than a token budget, so measure it on your own task.

How much does the Claude Batches API save?

50% on both input and output tokens, in exchange for asynchronous delivery. As of July 2026 that puts Opus 4.8 at $2.50 in / $12.50 out, Sonnet 5 at $1 / $5 on introductory pricing, and Haiku 4.5 at $0.50 / $2.50. The comparison worth noticing runs across tiers: a batched Opus 4.8 job costs less than a synchronous Sonnet 5 job at the standard rate from 1 September 2026, so batching buys a stronger model at the same money.