What you will be able to do
- Compare models by cost per completed task and pick a tier, upgrade or multi-model setup
- Use the effort parameter to trade thoroughness for token cost and speed, including each model's defaults
- Reduce real and perceived latency through model choice, shorter prompts and outputs, streaming and an elapsed-time clock
- Set max_tokens, task budgets and re-run strategies so a few costly agent runs don't drive up spend
1.Choosing a model by cost per completed task
Model choice is the first trade-off lever, and the per-token price can mislead you. What matters is how much it costs to get a task done. A model with a lower price per token can still cost more overall if it fails more often or uses more tokens to reach the same result. That is also why the guide says to upgrade when you aren't on the latest model. In Anthropic's measurements, each newer model solved at least as many tasks as the model before it, usually for less per solved task.
When quality falls short, the guide's first step is not to jump straight to the top model. If you lowered effort, restore it. If you didn't, try the next tier up at low effort. Pairing a stronger model with lower effort can cost less than running a weaker model at maximum effort.
| Your situation | Do this |
|---|---|
| You are not on the latest model | Upgrade, then compare on cost per completed task |
| Quality isn't good enough | Restore effort if you lowered it, otherwise try the next tier up at low effort |
| A lower-cost model stalls only on hard decisions | Add a frontier advisor, after pricing the advisor model alone and measuring the consult rate |
| The work exceeds one context window | Delegate partitions to cheaper workers (orchestrator strategy) |
Multi-model setups pay off less often. A second model was worth adding in only two shapes. In the first, an advisor, a cheaper executor calls a frontier model for hard decisions. That pays off only when the advisor is priced well above the executor and actually gets consulted. In the second, an orchestrator, a model splits work that won't fit in one context window and hands the parts to cheaper workers.
Checkpoint 1 of 7· Check yourself
Your output quality has dropped below target, and you never lowered effort. What does the guidance suggest trying first?
If quality falls short and effort wasn't lowered, the next step is one tier up at low effort. That is a smaller, cheaper move than going straight to maximum capability.
“If you lowered effort, restore it; otherwise try the next tier up at low effort”Source: platform.claude.com
Sources1
2.Effort: trading thoroughness for tokens on one model
The effort parameter controls how many tokens Claude spends on a response. You set it with output_config.effort. It applies to all output tokens: text, tool calls and their arguments, and thinking when thinking is active. So lower effort also means fewer, shorter tool calls. When costs are too high but quality is fine, the guide says to sweep effort down on your current model before you think about changing models.
Checkpoint 2 of 7· Fill the gap
Which key goes inside output_config to set the effort level?
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=4096,
messages=[
{
"role": "user",
"content": "Analyze the trade-offs between microservices and monolithic architectures",
}
],
output_config={" ? ": "medium"},
)
for block in response.content:
if block.type == "text":
print(block.text)Effort goes in output_config.effort, and the top-level parameter needs no beta header. budget_tokens, thinking and speed are separate parameters.
Source: platform.claude.com| Level | Description | Typical use case |
|---|---|---|
| max | Absolute maximum capability, no constraints on token spending | Deepest reasoning and most thorough analysis |
| xhigh | Extended capability for long-horizon work | Agentic and coding tasks over 30 minutes with token budgets in the millions |
| high | As many tokens as the task needs; the default except on Claude Opus 5.5 | Complex reasoning, difficult coding, agentic tasks |
| medium | Moderate token savings; the default on Claude Opus 5.5 | Agentic tasks balancing speed, cost and performance |
| low | Most efficient, with some capability reduction | Simple tasks needing best speed and lowest cost, such as subagents |
Defaults vary by model. Most models default to high, but Claude Opus 5.5 defaults to medium. A request that leaves out effort therefore runs one level lower on Opus 5.5 than it did on Opus 5. On Opus 5.5, adaptive thinking is always on, so effort is the main control over how much the model reasons and what a request costs. Levels are also calibrated differently across models: high on Claude Sonnet 5.5 does not produce the same amount of thinking as high on Claude Sonnet 5. The docs therefore say to run a new effort sweep on your own evals for each model rather than copying settings over. Several models, including Fable 5.1, Opus 5.5 and Sonnet 5.5, let you change effort partway through a conversation with a per-message output_config, and doing so keeps the prompt cache.
Effort is not a length control. On Claude Opus 5, changing effort does not reliably shorten the visible response, so ask for shorter answers in the prompt instead.
Checkpoint 3 of 7· Check yourself
You migrate a workload from Claude Opus 5 to Claude Opus 5.5 without setting effort explicitly. What changes?
Opus 5.5 defaults to medium, while Opus 5 and earlier Opus models default to high. Run an effort sweep instead of relying on the default.
“Most Claude models default to high effort, spending as many tokens as needed for excellent results; Claude Opus 5.5 defaults to medium.”Source: platform.claude.com
Checkpoint 4 of 7· Exam question
A team runs a nightly job that scores 50,000 archived support tickets against a rubric. The job has no interactive user waiting on results and currently completes in about six hours using standard synchronous API calls, at a cost the finance team has flagged as too high. What should the team do to reduce cost for this specific workload?
Correct answer: A — Submit the 50,000 requests through the Message Batches API, which processes them asynchronously at about half the cost of standard calls
- A. Correct. The Message Batches API is built for exactly this pattern: large volumes of independent requests with no requirement for an immediate response. It cuts cost by roughly 50% compared to standard synchronous calls, which directly addresses the cost concern for an overnight, non-interactive job.
- B. The 1-hour cache TTL costs more per write (2x base price) than the 5-minute TTL and is meant for content reused across a longer idle gap; it does not reduce the base per-call cost of 50,000 independent, largely unique ticket-scoring requests the way batch processing does.
- C. Extended thinking adds output tokens that are billed, which increases rather than decreases cost, and it does not change the synchronous, per-request billing structure that is the actual cost driver here.
- D. Raising effort to max increases token spend per request for maximum capability; it does not provide the roughly 50% cost reduction that comes specifically from asynchronous batch processing.
Sources2
3.Reducing latency, real and perceived
Latency is the time the model takes to process a prompt and generate its output. Two measures matter here. Baseline latency is the model's general speed. Time to first token (TTFT) is how long the first token of the response takes to appear, and it matters most when you stream.
The most direct lever is the model. For speed-critical applications, the docs point to Claude Haiku 4.5, which gives the fastest response times while keeping high intelligence.
client = anthropic.Anthropic()
# For time-sensitive applications, use Claude Haiku 4.5
message = client.messages.create(
model="claude-haiku-4-5",
max_tokens=100,
messages=[
{
"role": "user",
"content": "Summarize this customer feedback in 2 sentences: [feedback text]",
}
],
)
print(message.content[0].text)The next lever is token count. Fewer tokens to process and generate means a faster response. Keep prompts clear but concise. Claude doesn't know your context, so cutting too much can make instructions unclear. Ask Claude to keep its answer short, and set max_tokens as a hard ceiling. Lower temperatures, such as 0.2, can sometimes give more focused, shorter answers. Finding the right balance takes some experimentation.
Streaming makes the response feel faster without making it shorter. The output arrives as it is generated, so users can read it straight away, and you can process it in parallel.
Agents can also get a clock. The guide says to tell the model that time matters and show it the elapsed time. On three benchmarks, runs finished 33% to 69% faster at 28% to 54% lower cost per task, with scores up to 1.9 points lower. That is a trade-off, not a free win.
Checkpoint 5 of 7· Check yourself
What does enabling streaming mainly improve?
Streaming starts sending output before the response is complete. That makes the app feel more responsive and helps time to first token, but it does not reduce the work of generating the response.
“This can significantly improve the perceived responsiveness of your application, as users can see the model's output in real time.”Source: platform.claude.com
Checkpoint 6 of 7· Exam question
An agentic coding assistant runs long sessions that accumulate hundreds of tool calls, and the conversation regularly approaches the model's context window limit before the task is finished. Engineers want strategies that let the session continue productively without losing critical state. Which approaches address this goal?(Select 3)
Correct answers: A, B, C — Enable server-side compaction so earlier turns are automatically summarized once the conversation nears the context window limit; Configure context editing to clear old tool results once a token threshold is reached, keeping only recent tool use/result pairs; Use the memory tool to persist critical state to durable storage before old context is cleared, so a session recovers quickly
- A. Correct. Server-side compaction is the primary strategy for long-running conversations that approach context window limits: it automatically summarizes earlier turns on the server so the session can continue past the limit.
- B. Correct. Context editing's tool result clearing removes old tool results once a configured trigger is reached while preserving the most recent tool use/result pairs, directly freeing context space in tool-heavy agentic sessions.
- C. Correct. The memory tool's multi-session pattern is designed to offload critical state to durable storage before context is cleared or a new session starts, so essential information is not lost when older turns are summarized or removed.
- D. Lowering effort reduces token spend per turn but does not prevent the accumulated conversation history itself from growing and eventually approaching the context window limit.
- E. The Batch API is for independent asynchronous requests without immediate responses, not for continuing a single long-running interactive session, and splitting it into fresh-context chunks would lose the conversation's accumulated state.
- F. Raising effort to max increases token spend per turn for maximum capability; it does not reduce the number of turns needed and does not itself address a growing context window, since higher-effort turns can consume context faster.
4.Budgets, output caps and re-running failures
max_tokens is a hard limit on all output, which includes thinking as well as response text. If you set it too low, the run doesn't finish. If attempts end with stop_reason: max_tokens, raise the cap. At the default effort, 64,000 covered all but 2 of the 14,000 turns measured, and raising it to 128,000 added no cost per solved task. A cap that is too tight wastes the tokens spent on an attempt that never finishes.
In agent loops, a few very expensive runs can make up most of the bill. To limit them, combine three controls: a task budget (in beta, and supported only on some models), a Claude Managed Agents session budget, and a workspace spend limit.
If you can check outputs automatically, for example with tests or a verifier, you can mix effort levels. Run everything at low effort first, then re-run only the failures at high. On the coding benchmark Anthropic measured, the pass rate held at about half the cost.
Checkpoint 7 of 7· Check yourself
A coding agent's outputs are checked by a test suite. Which strategy did Anthropic measure as keeping the pass rate at about half the cost?
When a verifier can tell you which attempts failed, you only pay for high effort where low effort wasn't enough.
“Run everything at low effort and re-run failures at high; on the coding benchmark measured, the pass rate held at about half the cost”Source: platform.claude.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.The model with the lowest per-token price is the cheapest for a workload.Why is that wrong?
Compare models on cost per completed task. A cheaper model that solves fewer tasks, or uses more tokens to solve them, can cost more per solved task.
Covered in Choosing a model by cost per completed task
2.Lowering effort is a reliable way to shorten visible responses.Why is that wrong?
Effort controls how much the model thinks. On Claude Opus 5 it does not reliably shorten the response, so ask for shorter answers in the prompt.
Covered in Effort: trading thoroughness for tokens on one model
3.A small max_tokens always saves money on reasoning-heavy runs.Why is that wrong?
max_tokens caps thinking and response text together. Attempts that hit the cap end without finishing, and raising the cap to 128,000 added no cost per solved task.
Covered in Budgets, output caps and re-running failures
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligenceOfficial docs
“Compare on cost per completed task, not per token”
↩︎ Choosing a model by cost per completed task“Delegate partitions to cheaper workers”
↩︎ Choosing a model by cost per completed task“runs took 33% to 69% less time at a 28% to 54% lower cost per task, with scores up to 1.9 points lower”
↩︎ Reducing latency, real and perceived“Set a task budget (beta; check the support table for which models), a Claude Managed Agents session budget, and a workspace spend limit”
↩︎ Budgets, output caps and re-running failures“Upgrade; in Anthropic's measurements each newer model solved at least as many tasks as the one before it, usually for less per solved task”
↩︎ Exam trap 1“Raise max_tokens; 64,000 covered all but 2 of 14,000 turns measured at the default effort”
↩︎ Exam trap 3“If you lowered effort, restore it; otherwise try the next tier up at low effort”
↩︎ Checkpoint“Run everything at low effort and re-run failures at high; on the coding benchmark measured, the pass rate held at about half the cost”
↩︎ Checkpoint - 2.
“Lower effort also means fewer and terser tool calls.”
↩︎ Effort: trading thoroughness for tokens on one model“Run an effort sweep on your own evals rather than carrying settings over from an earlier model”
↩︎ Effort: trading thoroughness for tokens on one model“It's a hard limit on total output (thinking plus response text).”
↩︎ Budgets, output caps and re-running failures“Effort controls thinking volume, not visible response length: on Claude Opus 5, changing effort does not reliably shorten responses, so prompt for length instead.”
↩︎ Exam trap 2“Most Claude models default to high effort, spending as many tokens as needed for excellent results; Claude Opus 5.5 defaults to medium.”
↩︎ Checkpoint - 3.https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-latencyOfficial docs
“The fewer tokens the model has to process and generate, the faster the response will be.”
↩︎ Reducing latency, real and perceived“This can significantly improve the perceived responsiveness of your application, as users can see the model's output in real time.”
↩︎ Checkpoint