Skip to main content

Claude extended thinking — enabling and handling reasoning via the API

Extended thinking improves answer quality on hard problems. How to enable it via the thinking object, adaptive vs budget_tokens, summarized thinking and billing, when to use it, and pitfalls.

ByUpdated

Extended thinking lets Claude reason step by step before giving its final answer. On complex math, coding, or analysis where deep thinking helps, it can improve answer quality. This guide covers how to enable it via the API and what to watch for, grounded in the official docs. (Official: platform.claude.com/docs · as of September 2026, re-checked against the thinking and extended-thinking docs)

🟢 Current lineup (September 2026): Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). · model notice · Fable subscription
🔵 Current lineup (September 2026): Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). Parts of this article may still describe an earlier model.

Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (

🔵 Current lineup (September 2026): Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). Parts of this article may still describe an earlier model.
0/M input, $50/M output tokens). The one-time
🔵 Current lineup (September 2026): Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). Parts of this article may still describe an earlier model.
00 credit applied only to the Fable 5 transition and is not offered for 5.1. Some coding and debugging requests may be answered by an Opus model due to a security classifier (both models). See the Fable 5.1 guide and the Fable 5 availability guide for details.

Answer now vs think, then answerStandard responsefinal answer (text)fits simple, everyday tasksExtended thinking1. reasoning block (thinking)2. final answer (text)better quality on complex reasoningClaude 4 models return a summary of the reasoning · as of 2026.6

What extended thinking is

With extended thinking on, Claude first writes its reasoning in a thinking block, then incorporates it into a final answer (text block). The response includes the reasoning block followed by the answer. It helps most on problems that need step-by-step thought, rather than simple everyday tasks.

How to enable it (per the official docs, September 2026)

It depends on the model generation. On the current lineup — Claude Opus 5, Sonnet 5, and Fable 5.1 — thinking is on by default and needs no configuration. These models default to display: "omitted", so the thinking summary is hidden until you opt in with adaptive + display: "summarized":

import anthropic
client = anthropic.Anthropic()
msg = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=16000,
    thinking={"type": "adaptive", "display": "summarized"},
    messages=[{"role": "user", "content": "Solve this problem step by step"}],
)
  • Opus 4.6/4.7/4.8 and Sonnet 4.6 — thinking is off until you set thinking: {"type": "adaptive"}. Claude decides when and how deeply to think; steer depth with effort.
  • Manual mode (type: "enabled" + budget_tokens) — the only mode on 4.5 and earlier, deprecated on 4.6 (requests still succeed), and rejected with a 400 on 4.7 and later. Reusing an old budget_tokens sample on a current model fails with "thinking.type.enabled" is not supported — migrate to adaptive. If you do use manual mode, budget_tokens must be at least 1,024 and less than max_tokens.
  • Turning it off — Sonnet 5 and Opus 5 accept thinking: {"type": "disabled"}; on Opus 5 it cannot be disabled at xhigh or max effort (400).

Summarized thinking and billing

On Claude 4 models, the Messages API returns a summary of the reasoning, not the full stream. Importantly, billing is based on the full thinking tokens generated, not the summary — so the billed output token count may differ from what you see. You can track reasoning tokens via usage.output_tokens_details.thinking_tokens in the response; when streaming, this appears only on the final message_delta.

When to enable extended thinkingGood to enable· hard math / logic· tricky coding / debugging· multi-step analysis / planningOften unnecessary· simple queries / summaries· short structured transforms· when latency/cost mattersReasoning can be slower and costlier — choose per task · as of 2026.6

When to use it

Extended thinking suits complex tasks that benefit from step-by-step reasoning — math, tricky coding/debugging, multi-step analysis. For light tasks like simple queries, summaries, or structured transforms, you usually don't need it. Reasoning can make responses slower and costlier, so choose per task.

Things to watch

  • Incompatible settings — with thinking on, some of temperature/top_p/top_k are restricted (e.g. temperature only 1).
  • Response time — extra processing can make responses slower.
  • Large budgets — reasoning above 32k is best run via batch to avoid timeouts/connection limits (see reducing cost).
  • Volatility — parameters (adaptive, effort, budget_tokens) and supported models may change; the official docs are the source of truth.

In streaming, reasoning arrives as thinking_delta (see streaming). For errors/limits, see handling errors and rate limits; for the first call, see getting started with the Claude API.

Conversely, if a fixed output shape matters more, structured outputs may fit better.

For when to use extended thinking, web search, and Research, see the web search & Research guide.

Learn more: for how much one request can handle and how to manage tokens, see the context windows and tokens guide.

Extended-thinking parameters (adaptive, effort, budget_tokens), supported models, and the minimum budget may change (some are marked deprecated); verify the latest in the official docs (platform.claude.com/docs). This site is not an official Anthropic site.

Was this helpful?

Keep reading