Reasoning models and when to use extended thinking
Reasoning models generate a stream of intermediate thinking tokens before they write the answer. They were trained, largely with reinforcement learning, to use that scratchpad to plan, check their work and backtrack. In 2026 almost every frontier model is a reasoning model with a dial, and the engineering question is no longer "should I use a reasoning model" but "how much thinking does this request deserve".
Why it matters
Thinking buys accuracy on problems with many dependent steps: multi-file code changes, math, tricky analysis, agent planning, ambiguous instructions. It costs latency and money, because thinking tokens are billed as output tokens and generated one at a time. Turning thinking up on a simple classification task can multiply cost for no gain, while turning it down on a hard agent task can produce confident wrong answers. Setting the dial per task is one of the highest leverage cost and quality decisions you make.
How it works
On a reasoning request, the model first emits thinking content, then the visible answer. Providers differ in how much of the thinking you see: some return a summary, some return full thinking blocks, some return nothing but the token count. Either way the tokens are in the output budget.
Rendering diagram…
The controls in 2026
- Anthropic: recent Claude models use adaptive thinking, set with
thinking: {"type": "adaptive"}, where the model decides whether and how much to think. You steer depth with an effort level inoutput_config.effort(values such aslow,medium,high, with higher levels on some models). Third-party migration docs report that the older budget-based mode (type: "enabled"withbudget_tokens) is deprecated on newer models, andhighis the default effort. Thinking can be interleaved with tool calls, which matters for agents. - OpenAI: reasoning models in the Responses API take
reasoning: {"effort": ...}and can return reasoning summaries viareasoning.summary. They do not accepttemperature. - Google Gemini and open-weight families (for example DeepSeek's reasoning models) expose comparable thinking modes or budgets.
Exact effort levels differ by model, and sending an unsupported value returns an error, so read your model's page.
When to turn it up
- Multi-step problems where an early mistake ruins the result: code changes across files, data analysis, scheduling, legal or financial reasoning.
- Agentic loops where the model must plan which tools to call and recover from errors.
- Tasks where you can verify the answer but generating it is hard.
When to turn it down
- Classification, extraction, rewriting, translation and short chat replies.
- Latency-sensitive UX where a fast "good enough" beats a slow "perfect".
- High-volume background jobs where cost dominates and quality is already high at low effort.
Reference architecture
A common production pattern routes by difficulty and escalates on failure.
Rendering diagram…
The validation step can be a schema check, a unit test run, a confidence field or a second-model judgment. Escalation keeps average cost low while protecting the hard tail.
Code
The same question at two effort levels with OpenAI's Responses API, then the Anthropic equivalent with adaptive thinking. Requires recent versions of both SDKs.
from openai import OpenAI
import anthropic
question = "A train leaves at 09:40 and arrives at 13:05 after two 12-minute stops. What is the moving time?"
oa = OpenAI()
for effort in ("low", "high"):
r = oa.responses.create(
model="gpt-5-mini",
reasoning={"effort": effort},
input=question,
)
print(effort, r.usage.output_tokens_details.reasoning_tokens, "reasoning tokens")
print(r.output_text)
claude = anthropic.Anthropic()
msg = claude.messages.create(
model="claude-sonnet-4-6",
max_tokens=4096,
thinking={"type": "adaptive"},
output_config={"effort": "medium"},
messages=[{"role": "user", "content": question}],
)
for block in msg.content:
if block.type == "thinking":
print("[thinking]", block.thinking[:200])
elif block.type == "text":
print(block.text)
Compare the reasoning token counts. On an easy question like this one, low effort is usually just as correct, which is the whole point of measuring.
Trade-offs and pitfalls
- Hidden cost. Thinking tokens are billed as output even when you do not display them. Log them separately so dashboards show where money goes.
max_tokensmust cover thinking plus answer. Too small a limit can end the response during thinking with no visible answer.- Do not prompt for chain of thought on top. Hand-written "think step by step" instructions are redundant with native thinking and can make output verbose.
- Sampling parameters. Reasoning modes often reject or ignore
temperature,top_pand forced tool choice. Strip them from requests. - Preserve thinking blocks in tool loops. When a provider returns signed thinking blocks, pass them back unchanged in multi-turn tool use, or the request may fail.
- Latency perception. Long silent thinking feels broken. Stream thinking summaries or show progress (see streaming and UX).
- More thinking is not always better. Past a point, extra effort adds cost without accuracy, and can overcomplicate simple answers. Find the knee with evals.
Checklist
- Each task type has an explicit effort level chosen from eval results.
- Thinking or reasoning tokens are logged separately from answer tokens.
max_tokensleaves room for thinking on high-effort calls.- Unsupported sampling parameters are removed for reasoning requests.
- Hard tasks escalate from low to high effort on validation failure.
- The UI shows progress during long thinking.