[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
Extended Thinking & Budget Tokens
The Extended Thinking Mechanism
Anthropic's Extended Thinking on Claude 3.7 Sonnet allows the model to produce a hidden, detailed chain of thought before generating its final answer. This unlocks state-of-the-art performance on complex programming, algorithmic problem solving, and formal mathematical reasoning.
Configuring Thinking in the Messages API
Extended thinking is configured via the thinking object in the request body:
{
"model": "claude-3-7-sonnet-20250219",
"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:
- Minimum Budget:
budget_tokensmust be at least 1,024 tokens. - Max Tokens Constraint:
max_tokensmust be strictly greater thanbudget_tokens. - Temperature Restriction: When thinking is enabled,
temperaturemust be set to 1.0 (or omitted/default). Setting non-default temperature, top_p, or top_k will return a 400 Bad Request error. - Thinking Blocks: The API returns thinking content inside a
thinkingblock (type: "thinking"), followed by the visible answer in atextblock.
SYNAPSE VERIFICATION
QUERY 1 // 3
What is the minimum budget_tokens allowed when enabling Extended Thinking on Claude 3.7 Sonnet?
100 tokens
512 tokens
1,024 tokens
4,096 tokens