Follow Discord
Sweep 10 Nov 2026 · 02:18Z Build v2.1.322 539 read Stable v2.1.311 Latest v2.1.322 Next v2.1.322 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

optimizing-for-cost-and-intelligence changedabout-claude/models/optimizing-for-cost-and-intelligence

Recorded here
Lines+32added
Lines−60removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits36to this page, all time

The whole hunk

from line 1, old and new numbered
/
lines
from line 1
11---
22title: Optimizing for cost and intelligence
33url: https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence
4description: Balance cost and intelligence on the Claude Platform, with measured results for prompt caching, effort, model choice, output caps, and multi-model strategies.
4description: Balance cost and intelligence on the Claude Platform, with measured results for prompt caching, effort, model choice, output caps, and multimodel strategies.
55---
66 
77The most capable model can be too expensive at scale, and the least expensive model can fall short on quality. The Claude Platform gives you direct control over that tradeoff. You choose the model, the effort level, and the architecture for each request, which lets you place a workload almost anywhere on the cost-to-intelligence frontier.
from line 14
1414 
1515The levers come in two kinds:
1616 
17* **Free wins** cut spend without touching quality: prompt caching, token hygiene, a prompt audit against the model you are running, [batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) at 50% off for work that can wait up to 24 hours, and [workspace spend limits](https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces) as the backstop.
18* **Tradeoffs** exchange cost for intelligence: model choice, effort, output caps and session budgets, an elapsed-time clock, and multi-model architectures.
17* **Free wins** cut spend without touching quality: prompt caching, token hygiene, a prompt audit against the model you are running, and [batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) at 50% off for work that can wait up to 24 hours.
18* **Tradeoffs** exchange cost for intelligence: model choice, effort, output caps and session budgets, an elapsed-time clock, and multimodel architectures.
1919 
20Each lever comes with measured results and the rule for when it pays. In Anthropic’s measurements, prompt caching was usually the largest lever. The multi-model levers are narrower; a second model was measured in two shapes, an advisor and an orchestrator.
20A [workspace spend limit](https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces) is the backstop for both kinds of lever: see [Set budgets and output caps](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#set-budgets-and-output-caps).
2121 
22Each lever comes with measured results and the rule for when it pays. In Anthropic’s measurements, prompt caching was usually the largest lever. The multimodel levers are narrower; a second model was measured in two shapes, an advisor and an orchestrator.
23 
2224## Start here
2325 
2426Match your situation to a row.
from line 100
98100 
99101Anthropic measured a small agent that triages bug reports ([Trim input and context tokens](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#trim-input-and-context-tokens)) with pauses inserted before some turns to simulate a person’s delay<sup>[16](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. Accuracy stayed within run-to-run noise at every setting measured. Anthropic also measured extra requests that keep the 5-minute cache warm (keep-alive requests).
100102 
101To decide, count the gaps between consecutive requests in a conversation, and find your row in the following table:
103To decide, count the gaps between consecutive requests in a conversation, and find your row in the following table. A row that names your model takes precedence over a row with “Any” in the Model column:
102104 
103105| Your gaps between requests | Model | Use |
104106| ---------------------------------------------------------------------------------------------------------- | ------------------------------------- | -------------------------------------------------------- |
from line 108
106108| About 1 gap in 20 or more falls between 5 minutes and an hour, and few gaps run over an hour | Any | 1-hour duration |
107109| Gaps over an hour are common: about 60% or more of your pauses longer than 5 minutes also run past an hour | Any | 5-minute default |
108110| Only 1 or 2 gaps in 20 fall between 5 minutes and an hour, and none lasts more than about half an hour | Claude Opus 5.5 and Claude Sonnet 5.5 | 5-minute cache kept warm, instead of the 1-hour duration |
109| A pause comes before every turn | Claude Opus 5.5 and Claude Sonnet 5.5 | 1-hour duration |
111| A pause of more than 5 minutes comes before every turn, and few pauses run over an hour | Claude Opus 5.5 and Claude Sonnet 5.5 | 1-hour duration |
110112| Pauses run for minutes | Claude Fable 5.1 and Claude Fable 5.2 | 5-minute cache kept warm, instead of the 1-hour duration |
111| Pauses run toward an hour | Claude Fable 5.1 and Claude Fable 5.2 | 1-hour duration |
113| Pauses run toward an hour, and few run over an hour | Claude Fable 5.1 and Claude Fable 5.2 | 1-hour duration |
112114 
113115On Claude Haiku 5.5, use the “Any” rows: it reads the cache at the standard 0.1x the input price, twice the 0.05x of Claude Opus 5.5 and Claude Sonnet 5.5, so by list prices each keep-alive request costs twice as much, relative to the input price, as on those two models. A `max_tokens: 0` request refreshed its cache in a separate test (reference 16).
114116 
from line 192
190192 
191193#### What breaks the cache
192194 
193Keep per-request text in the newest user turn, after the last cache breakpoint, and make every cache-invalidating change at a natural break, such as the first request after a compaction. The cache is a byte-exact prefix match over the request in order (tools, then system prompt, then messages), so a change anywhere invalidates everything after it.
195Put per-request text, such as a status line, at the end of the newest user turn, after the last cache breakpoint. On later requests, leave each earlier turn as you sent it, with its old status line still in it. Make cache-invalidating changes at a natural break, such as the first request after a compaction. On models that run the [prefix check](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#prefix-check), a request that edits the system prompt or `tools` can get a 400 error even at such a break. Send those changes in `messages` instead, where your platform supports it (see [Make changes without editing the prefix](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#replace-prefix-edits)). The cache is a byte-exact prefix match over the request in order (tools, then system prompt, then messages), so a change anywhere invalidates everything after it.
194196 
195When something must change mid-conversation, send it in the form that keeps the cache, where the model supports it. In Anthropic’s test on Claude Fable 5.1, Claude Opus 5.5, and Claude Sonnet 5.5, on a cached conversation of about 100,000 tokens, editing the system prompt cost about 25 to 50 times what the same text cost as a mid-conversation system message. Changing effort at the top level cost 20 to 40 times what it cost per message<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>:
197When something must change mid-conversation, send it in the form that keeps the cache, where the model supports it. Anthropic tested each change both ways on Claude Fable 5.1, Claude Opus 5.5, and Claude Sonnet 5.5, on a cached conversation of about 100,000 tokens that held the model’s first reply with its thinking. Editing the system prompt cost about 25 to 50 times what the same text cost as a mid-conversation system message. Changing effort at the top level cost 20 to 40 times what changing it in a message cost<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>:
196198 
197199<Frame>
198200 ![Bar chart: system prompt edit up to $1.26 USD, top-level effort change up to $1.02 USD, either in a message up to $0.026 USD](https://platform.claude.com/docs/images/cost-intel/cache-break-cost.svg)
199201</Frame>
200202 
201At list prices, the stakes are highest on Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, and Claude Mythos 5.1, where a break rewrites the prefix at 1.25x the input price instead of reading it at 0.025x. On Claude Haiku 5.5, a system prompt edit cost 12.5x as much as an unchanged request, because the edit rewrote the whole conversation. On models that run the [prefix check](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#prefix-check), a request that makes this edit and sends earlier thinking blocks back can get a 400 error instead<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. On Claude Fable 5.2 and Claude Mythos 5.2, every account gets the 400 error by default, including accounts created before August 31, 2026. The top-level effort change, in a conversation that held the model’s first reply with its thinking, rewrote all but the system prompt. These figures are from the Messages API.
203When a change invalidates the cache, the part of the prefix it affects is written again instead of read. A write to the 5-minute cache costs 1.25x the input price, and a cache read costs a small fraction of the input price. At list prices, that write costs 50 times a read on Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, and Claude Mythos 5.1, where a cache read costs 0.025x the input price. That write costs 25 times a read on Claude Opus 5.5 and Claude Sonnet 5.5 (0.05x), and 12.5 times on Claude Haiku 5.5 (0.1x). The chart’s figures are from the Messages API.
202204 
205A request that edits the system prompt or `tools` can also fail outright. On models that run the [prefix check](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#prefix-check), a request that makes either edit and sends earlier thinking blocks back can get a 400 error<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. In a separate Anthropic test, waiting for a compaction didn’t avoid the error: on Claude Opus 5.5 and Claude Fable 5.2, such a request still got it as the first request after a compaction at a token threshold<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. By default on the Claude API, a request that fails the check gets the error on every account if the model is Claude Fable 5.2, Claude Mythos 5.2, or Claude Mythos 5.1. If the model is Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, or Claude Haiku 5.5, the request gets the error on some accounts and no error on others. For the outcomes by model and account, see [When `prefix_mismatch_behavior` is unset](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#enforcement).
206 
203207**What to do.**
204208 
205209* Put nothing that changes per request, such as a timestamp or a queue position, ahead of the stable prefix: it turns every request into a full cache write. In Anthropic’s test, a 25-token status line at the front of the system prompt made each request write the whole conversation; moved to the end of the newest user turn, it left the cache read intact<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>.
206210* The [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache) page lists the changes that invalidate the cache, such as a change to [`effort`](https://platform.claude.com/docs/en/build-with-claude/effort), the thinking configuration, the [`speed`](https://platform.claude.com/docs/en/build-with-claude/fast-mode) setting, the system prompt, or a tool definition. Changing the output format invalidates the cache for that conversation (see [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#prompt-modification-and-token-costs)).
207* Check which models support each form: [mid-conversation system messages](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages), and [per-message effort](https://platform.claude.com/docs/en/build-with-claude/effort#changing-effort-mid-conversation), which is in beta.
211* Check which models support each form: [mid-conversation system messages](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages), and [per-message effort](https://platform.claude.com/docs/en/build-with-claude/effort-per-message), which is in beta.
208212* After a cache-invalidating change, confirm cache reads have not dropped; if they have, [cache diagnostics](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics) shows where the prefix diverged.
209213 
210On an earlier model, Anthropic measured when to make such a change, on the triage agent’s long sessions<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. An effort change and an added tool cost more mid-session, or on the request that triggered the compaction, than on the first request after compaction. Accuracy was within run-to-run noise. The sessions with no changes cost more than those changed after compaction for another reason: they ran at the default effort throughout, and two of them compacted a second time, while the others started at low effort:
214On an earlier model, Anthropic measured when to make such a change, on long sessions of the issue-triage agent described in [Trim input and context tokens](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#trim-input-and-context-tokens)<sup>[18](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. The sessions that made changes started at low effort, then switched to the default effort and added one tool. Making the two changes mid-session cost the most. Making them on the request that triggered the compaction cost nearly as much, because that request still carried the whole conversation and wrote it to the cache again. Making them on the next request, the first after the compaction, cost the least. Accuracy was within run-to-run noise. That model doesn’t run the prefix check. On a model that does, add the tool in a message instead: see [Add or remove tools with `tool_addition` and `tool_removal`](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#tool-changes), which is in beta. The following chart also shows sessions with no changes. They aren’t a like-for-like baseline, because they ran at the default effort throughout and two of them compacted a second time:
211215 
212216<Frame>
213217 ![Bar chart, cost per triage session: $0.81 USD no changes, $0.95 USD mid-session, $0.92 USD at compaction, $0.75 USD after](https://platform.claude.com/docs/images/cost-intel/compaction-timing.svg)
from line 271
267271 
268272Anthropic measured these levers on an earlier model<sup>[28](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>:
269273 
274* In these runs, the prune was a short function in the issue-triage agent’s own code: at each task boundary, it replaced each search result of over 2,000 characters with a one-line extract.
270275* On the 20-issue run the levers saved little or nothing, and context editing made the run cost more.
271276* On the long run the prune and compaction both cut the cost, while context editing changed nothing.
272* The prune is a few lines you write yourself: at each task boundary, replace large stale tool results with a one-line extract.
273* The prune caches well because the edits sit at the tail of the conversation, where the next task adds new content anyway.
274* Run-wide, the prune and context editing cache about equally well. If you use context editing, [clear in a few large batches](https://platform.claude.com/docs/en/build-with-claude/context-editing#context-editing-and-prompt-caching).
277* If you use context editing, [clear in a few large batches](https://platform.claude.com/docs/en/build-with-claude/context-editing#context-editing-and-prompt-caching), because each clear costs a cache write.
275278 
276279<Note>
277 On Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5, rewriting an earlier tool result [invalidates every thinking block after it](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#prefix-check), so use compaction instead. The prune was measured on an earlier model without [preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking); on these models, [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) and [compaction](https://platform.claude.com/docs/en/build-with-claude/compaction) run on the server and don’t invalidate thinking blocks. [Send assistant turns back exactly as returned](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#append-assistant-turns-exactly-as-returned): dropping their thinking blocks costs output tokens on every turn, because Claude [re-creates the reasoning](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#drop-block-cost).
280 Don’t use the prune on Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Sonnet 5.5, or Claude Haiku 5.5. On these models, if your application rewrites an earlier tool result, that invalidates every thinking block already in the history after the result (see [Keeping the prefix unchanged](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#prefix-check)), and the request might fail (see [When `prefix_mismatch_behavior` is unset](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#enforcement)). The prune was measured on an earlier model without [preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking). Use [compaction](https://platform.claude.com/docs/en/build-with-claude/compaction) instead: in the same test, it also cut the cost of the long run. Compaction and [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) both run on the server, so neither invalidates thinking blocks. [Send assistant turns back exactly as returned](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#append-assistant-turns-exactly-as-returned): dropping their thinking blocks costs output tokens on every turn, because Claude [re-creates the reasoning](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#drop-block-cost).
278281</Note>
279282 
280The prune, adapted from the triage agent’s code:
281 
282```python
283import re
284 
285PRUNED = "[pruned at issue boundary]"
286 
287 
288def prune_task_boundary(messages, tool_name_by_id, threshold=2000):
289 """Call once per task boundary. Replaces large, stale search results with a one-line extract."""
290 for message in messages:
291 if message["role"] != "user" or not isinstance(message["content"], list):
292 continue
293 for block in message["content"]:
294 if not (isinstance(block, dict) and block.get("type") == "tool_result"):
295 continue
296 if tool_name_by_id.get(block.get("tool_use_id")) != "search_issues":
297 continue
298 result_text = block.get("content")
299 if not isinstance(result_text, str) or len(result_text) <= threshold:
300 continue
301 if result_text.startswith(PRUNED):
302 continue # already pruned on an earlier boundary
303 # cap single-line results so the extract stays short
304 first_line = result_text.split("\n", 1)[0].strip()[:200]
305 refs = re.findall(r"#(\d+)", result_text)[:5]
306 extract = f"{PRUNED} {first_line}"
307 if refs:
308 extract += " kept refs: " + " ".join("#" + r for r in refs)
309 block["content"] = extract
310```
311 
312283### Batch work that can wait
313284 
314285Route every request no one is waiting on through the [Batch API](https://platform.claude.com/docs/en/build-with-claude/batch-processing), and keep the interactive path for the rest. The Batch API takes 50% off every token of a request, including cached ones, in exchange for results arriving any time within 24 hours.
from line 396
425396 ![Bar chart of 20 WideSearch problems ranked by cost: the top two carry 43% of spend and the cheapest half 10%](https://platform.claude.com/docs/images/cost-intel/tail.svg)
426397</Frame>
427398 
428The [multi-model strategies](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#combine-models) exist to spend frontier intelligence on that tail without paying frontier rates for the rest.
399The [multimodel strategies](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#combine-models) exist to spend frontier intelligence on that tail without paying frontier rates for the rest.
429400 
430401### Upgrade the model
431402 
from line 453
482453 
483454**What to do.**
484455 
485* Sweep two or three effort levels on a sample of your own traffic, each in a separate session: changing top-level effort mid-session [invalidates the cache](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#cache-repeated-context) and distorts the comparison. The curve is the baseline any multi-model strategy must beat ([step 2 of measuring on your own workload](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#measure-on-your-own-workload)).
456* Sweep two or three effort levels on a sample of your own traffic, each in a separate session: changing top-level effort mid-session [invalidates the cache](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#cache-repeated-context) and distorts the comparison. The curve is the baseline any multimodel strategy must beat ([step 2 of measuring on your own workload](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#measure-on-your-own-workload)).
486457* On long-horizon coding, effort is a real tradeoff, which [re-running failures at higher effort](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#re-run-failures-at-higher-effort) turns back into a saving. At `medium`, Claude Sonnet 5.5 scored about 7 points lower than at its default, `high`, on the SWE-bench Pro<sup>[3](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup> subset for about 59% of the cost per task (2 runs each), and scored 62.7% compared with 77.8% on the internal agentic-coding benchmark<sup>[11](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup> (1 attempt per task).
487458* At `xhigh` and `max`, Claude Sonnet 5.5 can start its own rounds of review after it finishes a task, which takes more time and tokens. To keep that work on the task, add the prompt under “Thoroughness at `xhigh` and `max` effort” in [Prompting Claude Sonnet 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5#steer-initiative-and-scope) to your system prompt.
488459* On research tasks, measure the model you ship. Claude Fable 5.2 scored 3.3 points higher at `high` than at `low` on DeepResearch Bench II, for 3.2 times the cost, and not measurably higher at `medium` than at `low`; Claude Opus 5.5 scored 13.3 points lower at `low` than at `medium` on DRACO<sup>[21](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>. The two results come from different models on different benchmarks, so they show that the answer varies, not why.
from line 536
565536 
566537On HLE<sup>[22](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup> and an internal physics set<sup>[23](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#refs)</sup>, the typical task took 14% and 7% less time, and the physics score was 3.0 points lower. Lowering effort to `low` saved more time and cost than the changes did, and lost more score (reference 21). Check the score on your own tasks before you adopt the changes.
567538 
568For working code, see the Claude Cookbook recipe [Multi-agent teams under latency pressure and budgets](https://github.com/anthropics/claude-cookbooks/blob/main/patterns/agents/latency_multi_agent.ipynb), which applies both changes to a team of agents. To say that time matters in the system prompt instead, see [Time signals for multiagent harnesses](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#time-signals-for-multi-agent-harnesses).
539Reference 21 gives the exact text used for both changes in the measured runs. For working code, see the Claude Cookbook recipe [Multi-agent teams under latency pressure and budgets](https://github.com/anthropics/claude-cookbooks/blob/main/patterns/agents/latency_multi_agent.ipynb), which applies both changes to a team of agents. To use the system prompt instead of the first `user` message to say that time matters, see [Time signals for multiagent harnesses](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#time-signals-for-multi-agent-harnesses).
569540 
570541The following chart also plots a team, whose lead agent rarely started helpers, and a single agent at `low` effort:
571542 
from line 628
657628Measure on your own workload: the numbers on this page reflect list prices at the time of measurement and will drift as models and prices change, and your escalation rate, how cleanly tasks split, and transcript length move them too. The method stays the same:
658629 
6596301. Pull a few tasks from production logs, weighted like real traffic, and [write outcome checks](https://platform.claude.com/docs/en/test-and-evaluate/develop-tests) for each: tests pass, ticket closed, row count correct. Record cost per task beside the score.
6602. Baseline the model tiers across effort levels, not only the default, and plot score against spend. A multi-model configuration must beat the single model’s whole curve.
6613. If the curve shows a gap effort can’t close, add the multi-model strategy that fits and re-run the suite.
6312. Baseline the model tiers across effort levels, not only the default, and plot score against spend. A multimodel configuration must beat the single model’s whole curve.
6323. If the curve shows a gap effort can’t close, add the multimodel strategy that fits and re-run the suite.
6626334. Run the winner in shadow on a traffic slice before cutover, then keep the suite running.
663634 
664635**How to price a task.** Price each of the five token counts in a response’s `usage` at its own rate: uncached input, 5-minute and 1-hour cache writes at 1.25x and 2x the input price, cache reads, and output. Sum them across the task’s requests (the [Usage and Cost Analytics API](https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api) reports the aggregate). On Claude Haiku 5.5, use the rates for each request’s prompt length, counting cache reads and writes (see [Long context pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing)). When `usage.speed` is `"fast"`, use the [fast mode rates](https://platform.claude.com/docs/en/about-claude/pricing#fast-mode-pricing).
from line 638
667638 
668639<CodeGroup exclude="shell:cURL, shell:CLI">
669640 <CodeGroupItem language="cURL">
670 This calculation needs more logic than a single shell command. Use the [Claude SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) to run it.
641 This calculation needs more logic than a single shell command. Use the [Anthropic SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) to run it.
671642 </CodeGroupItem>
672643 
673644 <CodeGroupItem language="CLI">
674 This calculation needs more logic than a single shell command. Use the [Claude SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) to run it.
645 This calculation needs more logic than a single shell command. Use the [Anthropic SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) to run it.
675646 </CodeGroupItem>
676647 
677648 ```python Python
from line 783
812783 
813784 $client = new Client();
814785 $response = $client->messages->create(
815 model: 'claude-opus-5-5',
786 model: Model::CLAUDE_OPUS_5_5,
816787 maxTokens: 1024,
817788 messages: [['role' => 'user', 'content' => 'Hello, Claude']],
818789 );
from line 841
870841| Lower effort | On long coding tasks, `medium` cost about 30% to 52% less than `high`, and `low` about two thirds less | Up to 34 points lower, depending on the task and the model; 3.3 on one research agent | Faster | [Tune effort](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#tune-effort) |
871842| Re-run failures | About 40% less than running everything at `high`, at the same pass rate or slightly better | None | A second attempt on the tasks that fail | [Re-run failures at higher effort](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#re-run-failures-at-higher-effort) |
872843| Ask for shorter answers | About 13% less, from 39% fewer output tokens | None | Faster | [Set budgets and output caps](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#set-budgets-and-output-caps) |
873| Raising `max_tokens` | None: cost per solved task did not rise at 64,000 | A gain: up to 57 points more tasks solved at 64,000 on one coding benchmark; none on another | Neutral | [Set budgets and output caps](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#set-budgets-and-output-caps) |
844| Raise `max_tokens` | None: cost per solved task did not rise at 64,000 | A gain: up to 57 points more tasks solved at 64,000 on one coding benchmark; none on another | Neutral | [Set budgets and output caps](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#set-budgets-and-output-caps) |
874845| Advisor | None: about 2.1 times the cost of the model alone, on a coding benchmark | On coding, a small gain that may be chance; on chart reading, a loss | About 1.4 extra calls per attempt, on coding | [Advisor strategy](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#advisor-strategy-escalate-hard-decisions) |
875846| Orchestrator | With subagents on the next model down, about a third less than the orchestrator’s model alone at its default effort, on work larger than one context window; on routine work, measure first | No measurable loss on that work | Up to 25 subagents at a time | [Orchestrator strategy](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#orchestrator-strategy-delegate-bulk-work) |
876847| Fast mode | None: twice the standard token prices | None | Up to 2.5x higher output tokens per second | [Show the model elapsed time](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#show-the-model-elapsed-time) |
from line 1012
10411012 * **October 2026 test, one change to a long conversation:** Measured October 20, 2026, on Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5, on the Messages API with no tools, adaptive thinking, each model’s default effort, the 5-minute cache, a cache breakpoint on the system prompt, and [automatic caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#automatic-caching). The conversation held about 101,000 tokens: a 20,000-token system prompt, 13 user turns of filler text, the model’s own reply to the first turn with its thinking block, and one-word replies to the rest. Once one request had cached the conversation, a second added one short turn, and each measured request sent that longer conversation with one change. Two conversations per model gave the same result.
10421013 * **October 2026 test, tokens read and written:** With no change, and with a per-message effort change, the request read all 101,000 tokens and wrote none. With a 25-token mid-conversation system message, or a 25-token status line at the end of the newest user turn, it read them all and wrote only the new text. A top-level effort change (to `low` on Claude Fable 5.1 and Claude Sonnet 5.5, to `high` on Claude Opus 5.5 and Claude Haiku 5.5) read the 20,000-token system prompt and wrote 81,000 tokens. The same 25 tokens at the front or the end of the system prompt read nothing and wrote all 101,000. The request after a mid-conversation system message, a top-level effort change, or 25 tokens added to the end of the system prompt read the new prefix; a new status line at the front wrote everything again. A further test on October 21, 2026, on the same four models with conversations of 5,000 tokens, and on all but Claude Fable 5.1 with conversations of 100,000 tokens, all with one-word replies, sent a beta header for the first time mid-conversation, as a first per-message effort change may: that request read everything the request before it had cached, all 54 times. A system message sent with no beta header did the same, all 15 times.
10431014 * **October 2026 test, how priced:** The chart gives the prompt side of one request, from its `usage` fields at list prices. The chart’s values, in the order system prompt edit, system message, top-level effort change, and per-message effort change: Claude Fable 5.1 $1.26 USD, $0.026 USD, $1.02 USD, and $0.025 USD; Claude Opus 5.5 $0.50 USD, $0.020 USD, $0.41 USD, and $0.020 USD; Claude Sonnet 5.5 $0.25 USD, $0.010 USD, $0.20 USD, and $0.010 USD. The unchanged request repeated an earlier request byte for byte; a new turn of about 25 tokens adds under $0.001 USD. On Claude Haiku 5.5, whose requests were over 100,000 prompt tokens and so at its [long context prices](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing): $0.063 USD for the system prompt edit, $0.052 USD for the effort change, and $0.005 USD for the read. The requests ran on an Anthropic-internal organization whose usage is metered the same way as a customer organization’s. For that organization, the API lets failing thinking blocks through when a request leaves `prefix_mismatch_behavior` unset, so the system prompt edits in these tests were accepted. On an account created on or after August 31, 2026, 00:00 UTC, the same edit gets a 400 error on all four models, because each request sends an earlier thinking block back.
1015 * **November 2026 test, edits after a compaction:** Run November 9, 2026, on Claude Opus 5.5 and Claude Fable 5.2, on the Messages API with adaptive thinking, `high` effort, no caching, one tool defined, `tool_choice` set to `none`, [`prefix_mismatch_behavior`](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#mismatch-behavior) set to `"error"`, and [compaction at a token threshold](https://platform.claude.com/docs/en/build-with-claude/compaction-threshold) with a trigger of 50,000 tokens. A first request of about 55,700 tokens triggered a compaction, and its reply held a compaction block followed by a thinking block. The next request sent that reply back with one new user turn. Unchanged, it succeeded. With one tool added to `tools`, or with the system prompt reworded, it got the 400 error. In a conversation with no compaction, the same two edits got the 400 error, and so did removing a text block from an earlier user turn. One conversation of each kind per model. On Claude Fable 5.2, the first large conversation’s reply held no thinking block. A second conversation replaced the first, with a harder question, a higher `max_tokens`, and custom compaction `instructions`, and only the second counts. The requests ran on the Claude API.
10441016 * **What was measured:** The triage agent’s long variant from [Trim input and context tokens](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#trim-input-and-context-tokens), run August 24, 2026, on Claude Sonnet 5 with the 5-minute cache, cost from the usage fields at list prices, five sessions per arm: a no-change arm at the default effort throughout ($0.81 USD per session), and two arms that start at low effort and make the same two cache-breaking changes, a switch to the default effort and one added tool, either mid-session at requests 12 and 17 ($0.95 USD) or together on the first request after the first compaction ($0.75 USD).
10451017 * **Fourth arm:** A fourth arm of six sessions, run August 25, 2026, made the same two changes on the request that triggered the first compaction ($0.92 USD per session): that request’s summarization pass wrote the 81,000-token context to the cache instead of reading it, so that pass cost $0.21 USD against $0.04 USD for the same pass in the boundary arm.
10461018 * **Compaction:** Sessions first compacted at request 21 to 25 (16 of the 21 sessions at request 22), once the prompt passed the 80,000-token compaction trigger, and two no-change sessions compacted a second time near the end. The boundary arm’s lower total than the no-change arm reflects its low-effort requests before the change and those second compactions rather than caching: the two arms’ re-write costs differ by under $0.01 USD.
from line 1070
10981070 
1099107125. **Claude Managed Agents task set:**
11001072 
1101 * **What was measured:** An Anthropic-internal set of 79 scripted agent tasks in eight areas, including memory, multi-agent, and long-context work, run as [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) sessions in which the test answers every tool call. Each task ran five times per model.
1073 * **What was measured:** An Anthropic-internal set of 79 scripted agent tasks in eight areas, including memory, multiagent, and long-context work, run as [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) sessions in which the test answers every tool call. Each task ran five times per model.
11021074 * **Runs:** The figures are from one run per model on October 7, 2026, graded that day. In three more runs of the same tasks on October 8 and 9, 2026, Claude Haiku 5.5 passed 91% to 93% of attempts, and in one more run on October 8, Claude Haiku 4.5 passed 63%.
11031075 * **How scored:** An attempt passed only if the grader, Claude Sonnet 4.6, grading once, marked every line of the task’s checklist as met, so pass rates depend on the grader. On all but one task, a separate call, shown the tool results in full, graded the line that checks the files and messages the agent wrote through its tools against those results.
11041076 * **How priced:** Costs are token costs at list prices with 5-minute prompt caching, priced request by request, and exclude session runtime.
Feedback