Reasoning models and effort
When models think before answering, and how to control it.
Create a free account Try part of it here
Why it matters
Modern models can think before they answer. They work through a problem in private, then write the reply. That's why they can now plan an analysis, fix broken code or weigh the options in a brief. But thinking costs tokens, and tokens cost time and money. You can set how hard the model thinks, one task at a time. That setting is one of the biggest levers you have on quality, speed and cost.
What you'll be able to do
- Explain what thinking is and why it improves answers to hard problems
- Set the effort level on a request and choose it for a task
- Read thinking blocks in a response, and ask for readable summaries
- Budget max_tokens and cost for requests that think
What it covers
- What thinking is
- Adaptive thinking and effort
- Reading thinking in a response
- Thinking costs tokens
- Worked example: what does more effort cost?
- Keeping thinking blocks in conversations
What thinking is
Think about how you add up a long restaurant bill. A small bill you can do in your head. A long one, split six ways with a tip, you work out on a napkin first. Then you say the total.
Models can do the same. Before writing the answer you see, a model can write thinking: its working, step by step, like notes on scratch paper. A model that does this is called a reasoning model.
More thinking tends to help with four kinds of work:
- Problems with many steps, like budgets, schedules or "which campaign should we cut, and why?"
- Writing code and analyzing data.
- Following long, detailed instructions.
- Checking its own work before it answers.
It helps much less with simple tasks. Tagging a review as positive is one. Writing an email subject line is another. There, the extra time and tokens buy you very little.
Show the answer
Planning how to split a yearly budget across five campaigns
The budget plan has many steps and trade-offs to weigh, so working it through first pays off. The other three are short and simple, so extra thinking adds time and cost without much gain.
Adaptive thinking and effort
Claude Opus 5.5 always thinks adaptively. That means it decides for itself how much thinking each request needs. You can't switch thinking off on this model.
What you control is effort: how thorough the model should be. Think of asking a mechanic for a quick look or a full inspection. Both are useful. The full one takes longer and costs more.
You set effort inside output_config, a part of the request body:
body = {
"model": "claude-opus-5-5",
"max_tokens": 8000,
"output_config": {"effort": "low"}, # low, medium, high, xhigh or max
"messages": [{"role": "user", "content": "Tag this review: 'Arrived chipped.'"}],
}
There are five levels. Here is when to use each one:
| Effort | Use it for |
|---|---|
low | Classification, short extraction, chat replies, high-volume steps |
medium | Everyday writing and analysis (the default on Opus 5.5) |
high | Hard analysis, important documents, multi-step plans |
xhigh | Coding and long agent tasks |
max | When correctness matters far more than cost or time |
Lower effort means fewer thinking tokens. You get faster replies at a lower cost. When a request is too slow or too expensive, try lowering effort first. Switching to a smaller model can come after that.
Watch out: older tutorials show
"thinking": {"type": "enabled", "budget_tokens": 5000}. Current models reject that with an error. Use effort instead. The same goes fortemperature. The current API version no longer accepts it.
Start low and raise it only when an eval says quality needs it.
Show the answer
high
Hard analysis and important documents call for high effort. Low effort is for quick, simple steps. Thinking can't be switched off on this model, and thinking budgets are rejected with an error.
Reading thinking in a response
A reply's content is a list of blocks. Each block is a dictionary with a type. Thinking comes back in thinking blocks. They arrive before the text block that holds the answer.
By default, the thinking text is left empty. The model did think, but you only get the answer. To see a readable summary of its reasoning, ask for one:
"thinking": {"type": "adaptive", "display": "summarized"}
You never get the model's raw reasoning, only a summary. A summary is still useful. It helps you fix a prompt that goes wrong. It can also show users why an answer came out the way it did.
Here is a full request. It asks a budget question about two kinds of ads, at high effort:
import requests response = requests.post( "https://api.anthropic.com/v1/messages", headers={"x-api-key": "added-by-the-academy-server", "anthropic-version": "2026-10-21"}, json={ "model": "claude-opus-5-5", "max_tokens": 4000, "thinking": {"type": "adaptive", "display": "summarized"}, "output_config": {"effort": "high"}, "messages": [{"role": "user", "content": "We have $5,000. Search returns $5.20 per $1, display $2.70. Split the budget?"}], }, timeout=120, ) data = response.json() for block in data["content"]: if block["type"] == "thinking": print("THINKING SUMMARY:", block["thinking"][:120]) elif block["type"] == "text": print("ANSWER:", block["text"][:120]) print("output tokens:", data["usage"]["output_tokens"])
The loop walks through the blocks one at a time. It checks each block's type. A thinking block prints the first 120 characters of the summary. A text block prints the first 120 characters of the answer. The last line prints how many output tokens the reply used. That count includes the thinking.
Thinking costs tokens
Thinking tokens are output tokens. You pay for them at the output price, even when you can't see the text. They also count toward max_tokens, the cap you set on how much the model may write. Two rules follow from that.
- Leave room. Say
max_tokensis tight. The model can spend it all on thinking and stop before it finishes the answer. The reply'sstop_reasonfield, which says why the model stopped, will then be"max_tokens". For anything beyond a simple task, amax_tokensof several thousand is normal. - Check usage.
usage["output_tokens"]includes the thinking. So it can be much larger than the answer you see. That's the number to use when you estimate cost.
You met the cost rule in the tokens lesson:
cost = tokens ÷ 1,000,000 × price per million
In plain words: work out what share of a million tokens you used. Then take that share of the price. For thinking, use the output price and the full output count.
Here it is with small numbers. Say output costs $20 per million tokens. A reply shows you a 200-token answer, but usage reports 2,000 output tokens. The other 1,800 were thinking. You pay for all 2,000: 2,000 ÷ 1,000,000 = 0.002, and 0.002 × $20 = $0.04. The visible answer alone would have been $0.004. So the thinking made this reply ten times as expensive.
Worked example: what does more effort cost?
Two requests send the same short prompt. One runs at low effort and writes 300 output tokens. The other runs at high effort and thinks much longer, so it writes 3,000. These counts are made up to keep the sums easy, and real counts vary from call to call. The prices are Claude Opus 5.5's at the time of writing, as in the tokens lesson.
INPUT_PRICE = 4.00 # dollars per million input tokens OUTPUT_PRICE = 20.00 # dollars per million output tokens def cost(usage): input_cost = usage["input_tokens"] / 1_000_000 * INPUT_PRICE output_cost = usage["output_tokens"] / 1_000_000 * OUTPUT_PRICE return input_cost + output_cost low = {"input_tokens": 50, "output_tokens": 300} high = {"input_tokens": 50, "output_tokens": 3000} print(f"low effort: ${cost(low):.4f} per request") print(f"high effort: ${cost(high):.4f} per request") print(f"10,000 requests: ${cost(low) * 10_000:,.2f} vs ${cost(high) * 10_000:,.2f}")
The input is the same 50 tokens both times, so it costs $0.0002 either way. The output is where the gap opens. At low effort it's 300 tokens, $0.006. At high effort it's 3,000 tokens, $0.06. One request at a time, these are tiny sums. Over 10,000 requests they become $62.00 versus $602.00. That's why high-volume, simple steps should run at low effort.
Show the answer
The model used the 300 tokens thinking and ran out before writing the answer
Thinking counts toward max_tokens. Raise max_tokens, or lower effort so it thinks less.
print(5000 / 1_000_000 * 20)
Show the answer
0.1
5,000 ÷ 1,000,000 = 0.005, and 0.005 × 20 = 0.1. So a reply with 5,000 output tokens, thinking included, costs ten cents. 0.005 forgets to multiply by the price.
Keeping thinking blocks in conversations
In a conversation with several turns, you send the earlier messages back with each new request. The lesson on conversations and memory covers how. When you do, send the assistant's whole content list back. Include the thinking blocks, and don't change them.
This matters most once the model uses tools, which you'll meet soon. With its earlier thinking in front of it, the model picks up where it left off. Without it, the model starts its reasoning over.
Show the answer
The whole content list, thinking blocks included and unchanged
Send the assistant's content back exactly as it came, thinking blocks and all. Then the model can pick up its earlier reasoning instead of starting over.
Practice what you just read
- 4 code examples you can edit and run
- a practice exercise that checks your code
- a 5-question quiz
- 4 review cards for spaced repetition
Try a quiz question
You run 200,000 review-tagging requests a day on Claude Opus 5.5 and they're slower than you'd like. What should you try first?