CONCEPT Reasoning as a first-class API capability
Extended thinking is a native capability: instead of coaxing step-by-step reasoning through
prompt wording (5.1–5.2), you turn it on with the thinking parameter. The model then reasons in
dedicated thinking content blocks that come back separate from the final
text answer — no tags to write, no regex to strip. You control how much it reasons with a
reasoning budget or an effort level.
CONCEPT Budget vs. effort — two ways to size the reasoning
How you dial the reasoning depends on the model generation:
| Mode | Config | Applies to |
|---|---|---|
| Manual budget | thinking: {type: "enabled", budget_tokens: N} — N must be < max_tokens | Older models (e.g. Opus 4.5, Haiku 4.5). Deprecated on 4.6; returns 400 on Opus 4.7/4.8, Sonnet 5, Fable 5. |
| Adaptive + effort | thinking: {type: "adaptive"} + output_config: {effort: "low"|"medium"|"high"|"xhigh"|"max"} | Current models. The model decides when/how much to think; effort tunes depth. |
The response format is the same either way: thinking blocks (each carrying a
signature) precede the text answer. A display setting
("summarized" vs "omitted") controls whether the reasoning text is surfaced — you're
billed for the full thinking tokens regardless.
DIAGRAM Two roads to step-by-step reasoning
or native thinking?"} B -->|"prompt wording"| C["Prompted CoT (5.1/5.2)
reasoning in the text body"] B -->|"thinking parameter"| D{"Which model?"} D -->|"older"| E["🔵 enabled + budget_tokens"] D -->|"current"| F["🟢 adaptive + effort"] E --> G["Separate 'thinking' blocks
+ signature, then 'text'"] F --> G G --> H["🚫 no assistant prefill
while thinking is on"] classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef mid fill:#cfe2ff,stroke:#0d6efd,color:#084298; classDef bad fill:#f8d7da,stroke:#dc3545,color:#721c24; class F ok; class E mid; class C mid; class H bad;
CODE Enable thinking, read the separate blocks
On current models, adaptive thinking + effort. The reasoning arrives as thinking blocks you can
log or ignore; the answer is the text block.
# Current models: native reasoning, no prompt tricks, no prefill allowed. resp = client.messages.create( model="claude-opus-4-8", max_tokens=16000, thinking={"type": "adaptive"}, # native reasoning on output_config={"effort": "high"}, # tune depth: low..max messages=[{"role": "user", "content": "Prove there are infinitely many primes ≡ 3 (mod 4)."}], ) for block in resp.content: if block.type == "thinking": log(block.thinking) # separate reasoning block (+ block.signature) elif block.type == "text": show(block.text) # the final answer # Older models instead: thinking={"type": "enabled", "budget_tokens": 10000} # (budget_tokens must be < max_tokens; 400 on Opus 4.7/4.8, Sonnet 5, Fable 5)
thinking blocks (and their signature) unmodified when you
send them back in a later turn — the signature is an integrity check and altering it returns a 400. This matters
most during tool-use loops (see 5.4).TRADE-OFFS Prompted CoT vs. extended thinking
✅ Extended thinking
- Native reasoning; no prompt engineering
- Reasoning in separate blocks — nothing to strip
- Adaptive + effort auto-tunes depth to difficulty
- Reasoning preserved across tool calls via signatures
⚠️ Costs & constraints
- Thinking tokens are billed and add latency
- No assistant prefill while enabled
- Tool-use pairs it with constraints (5.4)
budget_tokensis gone on the newest models
EXAM TRAPS
budget_tokens on a current model. → It's deprecated on 4.6 and
returns a 400 on Opus 4.7/4.8, Sonnet 5, and Fable 5. Use thinking: {type: "adaptive"}
with effort.content[0]. → With thinking on, the
thinking block(s) come first; the answer is the text block — iterate and check
block.type.signature before replaying
it. → The signature must be passed back unmodified, or the API returns a 400.PRACTICE
Q1 · A candidate sets budget_tokens on claude-opus-4-8 and gets a 400. Why?
Manual budget_tokens is removed on the newest models (Opus 4.7/4.8, Sonnet 5,
Fable 5). Use thinking: {type: "adaptive"} and control depth with
output_config: {effort: ...} instead.
Q2 · Why can't you prefill the assistant turn with extended thinking enabled?
Native reasoning generates the assistant turn's leading content itself, so a client-supplied prefill on that turn conflicts with it and the request is rejected. Use structured outputs or an explicit instruction to steer the answer's shape.
Q3 · How does the reasoning come back differently from prompted structured CoT?
Extended thinking returns reasoning in separate thinking content blocks
(each with a signature), so you never tag or regex it out — you just read the text
block. Structured CoT keeps reasoning inline in the response body inside tags you defined.