Skip to main content

Extended Thinking & Budget Tokens — Extended Thinking & Adaptive Reasoning

[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Extended Thinking & Budget Tokens

🧠 Extended Thinking & Adaptive Reasoning⏱ 20 min⭐ 1100 BASE XP⌨ HANDS-ON LAB

From Manual Budget Tokens to Adaptive Reasoning

Anthropic pioneered Extended Thinking on Claude 3.7 Sonnet (retired Feb 19, 2026) and legacy Claude 4.5 models (claude-haiku-4-5), enabling the model to emit a verifiable internal chain of thought (type: "thinking") before its final answer. Important October 2026 Migration Rule: Starting with Claude 4.7 and across all Claude 5.x models (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5), manual budget_tokens (type: "enabled") is deprecated and rejected with an HTTP 400 error—replaced by thinking: { type: "adaptive" } and output_config.effort.

Legacy budget_tokens Schema (Haiku 4.5 Maintenance Only)

{
  "model": "claude-haiku-4-5",
  "max_tokens": 16000,
  "thinking": {
    "type": "enabled",
    "budget_tokens": 4096
  },
  "messages": [
    { "role": "user", "content": "Write an optimized red-black tree in Rust with full invariant tests." }
  ]
}

Critical API Rules for Thinking Blocks:

  • Claude 5.x Standard: Use thinking: { type: "adaptive" } + output_config: { effort: "low" | "medium" | "high" | "max" } (passing budget_tokens or temperature on 5.x throws HTTP 400).
  • Legacy Minimum Budget (4.5 only): Where supported on legacy 4.5 endpoints, budget_tokens required at least 1,024 tokens and max_tokens > budget_tokens.
  • Signed Thinking Blocks: The API returns thinking inside a thinking block accompanied by a cryptographic signature. In multi-turn tool loops, thinking blocks must be passed back unmodified.
⌨ HANDS-ON LABUnderstand Legacy Budget Tokens vs Modern Adaptive Thinking
⭐ +200 XP

Legacy models (such as Claude Haiku 4.5 and retired Claude 3.7 Sonnet) used manual budget_tokens, whereas Claude 5.5 models reject budget_tokens (HTTP 400) in favor of adaptive thinking. Inspect the legacy budget_tokens contract on claude-haiku-4-5.

1POST to /v1/messages on legacy claude-haiku-4-5 with thinking enabled and budget_tokens set to 2048.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 1 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 3
What happens if you pass legacy thinking: { type: 'enabled', budget_tokens: 4096 } to Claude Opus 5.5 or Sonnet 5.5?
It runs twice as fast
The API rejects the request with an HTTP 400 error; Claude 5.x models use thinking: { type: 'adaptive' } and output_config.effort instead
It ignores thinking silently
It enables Batch mode