The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 38
3838}
3939```
4040
41You don't always see this text, and what you see is never the raw chain of thought: the text in a thinking block is a [summary of Claude's reasoning](https://platform.claude.com/docs/en/build-with-claude/thinking#summarized-thinking). The `display` field on the thinking configuration controls whether that summary is returned at all: `"summarized"` returns it, while `"omitted"`, the default on the newest models, returns thinking blocks with an empty `thinking` field. Either way the block is billed the same and passed back the same in multi-turn conversations. See [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display) for per-model defaults and details.
41You don't always see this text, and what you see is never the raw chain of thought: the text in a thinking block is a [summary of Claude's reasoning](https://platform.claude.com/docs/en/build-with-claude/thinking#summarized-thinking). The `display` field on the thinking configuration controls whether that summary is returned at all: `"summarized"` returns it, while `"omitted"`, the default on many models, returns thinking blocks with an empty `thinking` field. Either way the block is billed the same and passed back the same in multi-turn conversations. See [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display) for per-model defaults and details.
4242
4343If Claude uses tools, thinking can also appear between tool calls. See [Thinking with tool use](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-with-tool-use). For the full response format, see the [Messages API reference](https://platform.claude.com/docs/en/api/messages/create).
4444
4545## Configuring thinking
4646
47On current models, thinking is on by default or one parameter away. Which configuration each model accepts, and what it defaults to, is listed in the [per-model configuration table](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting#supported-models) on the Troubleshooting page.
48
49On Claude Opus 5, Claude Sonnet 5, Claude Fable 5, Claude Mythos 5, and Claude Mythos Preview, thinking is already on: no configuration needed. The first thing most developers need on these models is to see the thinking text, because `display` defaults to `"omitted"` there. Opt in with `thinking: {"type": "adaptive", "display": "summarized"}`, which is exactly the following request with the [model string](https://platform.claude.com/docs/en/models/overview) swapped.
47On most models, thinking is on by default or one parameter away. Which configuration each model accepts, and what it defaults to, is listed in the [per-model configuration table](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting#supported-models) on the Troubleshooting page.
48
49On Claude Opus 5, Claude Sonnet 5, Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, and Claude Mythos Preview, thinking is already on and needs no configuration. `display` defaults to `"omitted"` on these models, so the thinking text is hidden until you opt in. Opt in with `thinking: {"type": "adaptive", "display": "summarized"}`, which is exactly the following request with the [model string](https://platform.claude.com/docs/en/models/overview) swapped.
5050
5151On Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6, thinking is off until you set `thinking: {type: "adaptive"}`, which lets Claude decide when and how deeply to think based on the request. The following examples do that, set `display: "summarized"` so the thinking text is visible, and use a roomy `max_tokens`:
5252
from line 430
430430
431431Claude Opus 5 also has thinking on by default and accepts `thinking: {type: "disabled"}` at [effort](https://platform.claude.com/docs/en/build-with-claude/effort) `high` or below. At `xhigh` or `max` effort, thinking cannot be turned off: requests that combine `thinking: {type: "disabled"}` with those effort levels return a 400 error. This restriction applies to Claude Opus 5 and later models and is enforced on each request. With thinking disabled, Claude Opus 5 can occasionally emit tool calls as plain text or include internal XML tags in its visible output. See [Running with thinking disabled](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5#running-with-thinking-disabled) for prompting mitigations.
432432
433Claude Fable 5, Claude Mythos 5, and Claude Mythos Preview reject `thinking: {type: "disabled"}`: thinking cannot be turned off on these models.
433Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, and Claude Mythos Preview reject `thinking: {type: "disabled"}`. Thinking can't be turned off on these models.
434434
435435If your model supports only extended thinking (see the [per-model configuration table](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting#supported-models)), configure it with `type: "enabled"` and a `budget_tokens` value instead. The [Extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) page covers that configuration. And if any thinking configuration comes back with a 400 error, [Troubleshooting thinking](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting) matches each error message to its fix.
436436
from line 438
438438
439439### Controlling thinking display
440440
441The `display` field on the thinking configuration controls how thinking content is returned in API responses. `display` works in both modes: set it alongside `type: "adaptive"` or `type: "enabled"`. It accepts two values:
441The `display` field on the thinking configuration controls how thinking content is returned in API responses. `display` works in both modes: set it alongside `type: "adaptive"` or `type: "enabled"`. It accepts these values:
442442
443443* `"summarized"`: thinking blocks contain [summarized thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#summarized-thinking) text, a readable summary of Claude's reasoning. This is the default on Claude Opus 4.6, Claude Sonnet 4.6, and earlier models.
444* `"omitted"`: thinking blocks are returned with an empty `thinking` field. The `signature` field still carries the encrypted full thinking for multi-turn continuity (see [Thinking encryption](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-encryption)). This is the default on Claude Fable 5, Claude Mythos 5, Claude Opus 5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, and [Claude Mythos Preview](https://anthropic.com/glasswing).
444* `"omitted"`: thinking blocks are returned with an empty `thinking` field. The `signature` field still carries the encrypted full thinking for multi-turn continuity (see [Thinking encryption](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-encryption)). This is the default on Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude Opus 5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, and [Claude Mythos Preview](https://anthropic.com/glasswing).
445* `"updates"` (beta): reasoning blocks are returned with an empty `thinking` field, as with `"omitted"`, and the short [progress updates](https://platform.claude.com/docs/en/build-with-claude/thinking#progress-updates) some models write between tool calls come back as readable text. Requires the beta header `thinking-display-updates-2026-08-18`.
445446
446447Set `display: "omitted"` when your application doesn't surface thinking content to users. The primary benefit is faster time-to-first-text-token when streaming: the server skips streaming thinking tokens entirely and delivers only the signature, so the final text response begins streaming sooner.
447448
from line 470
469470* If you pass thinking blocks back in multi-turn conversations, pass them unchanged. The server decrypts the `signature` to reconstruct the original thinking for prompt construction (see [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks)). Any text you place in the `thinking` field of a round-tripped omitted block is ignored.
470471* `display` is invalid with `thinking.type: "disabled"` (there is nothing to display).
471472* When using `thinking.type: "adaptive"` and the model skips thinking for a simple request, no thinking block is produced regardless of `display`.
472* When streaming with `display: "omitted"`, no `thinking_delta` events are emitted. See [Streaming thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#streaming-thinking) for the event sequence.
473* When streaming with `display: "omitted"`, no `thinking_delta` events are emitted. With `display: "updates"`, only [progress-update blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#progress-updates) stream `thinking_delta` events. See [Streaming thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#streaming-thinking) for the event sequence.
473474
474475<Note>
475 The `signature` field is identical whether `display` is `"summarized"` or `"omitted"`. Switching `display` values between turns in a conversation is supported.
476 The `signature` field is identical whichever `display` value you set. Switching `display` values between turns in a conversation is supported.
476477</Note>
477478
478479In the Ruby SDK, plain hashes take `display:` as the examples show. The typed `ThinkingConfigAdaptive` class names the parameter `display_` (trailing underscore, to avoid shadowing Ruby's `Kernel#display`). Either way, the wire field is still `display`.
from line 494
493494 In rare cases where you need access to full thinking output, [contact Anthropic sales](mailto:[email protected]).
494495</Note>
495496
497To see the model's reasoning, read the `thinking` blocks rather than prompting for reasoning in the response text. On Claude Fable 5.1 and Claude Fable 5, a request that attempts to elicit the model's internal reasoning as part of the response text can be refused with `stop_details.category: "reasoning_extraction"`. See [Refusal categories](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response) for the field reference and handling guidance.
498
496499### Streaming thinking
497500
498501Thinking works with [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming). Thinking blocks stream as `thinking_delta` events inside `content_block_delta` events, followed by a single `signature_delta` event just before the block's `content_block_stop`. Text blocks stream afterward as usual.
499502
500
503
501504
502505The following examples stream a response with adaptive thinking, printing thinking and text deltas as they arrive:
503506
from line 796
793796data: {"type":"content_block_start","index":1,"content_block":{"type":"text","text":""}}
794797```
795798
799With `display: "updates"` (beta), reasoning blocks stream as they do under `"omitted"`. Each [progress-update block](https://platform.claude.com/docs/en/build-with-claude/thinking#progress-updates) streams its text as `thinking_delta` events before the `tool_use` block it introduces. A pause of several seconds before the progress-update block opens is normal:
800
801```sse Output
802event: content_block_start
803data: {"type":"content_block_start","index":1,"content_block":{"type":"thinking","thinking":"","signature":""}}
804
805event: content_block_delta
806data: {"type":"content_block_delta","index":1,"delta":{"type":"thinking_delta","thinking":"Confirmed the retry path never refreshes the expired token. Editing auth.py to add the refresh call."}}
807
808event: content_block_delta
809data: {"type":"content_block_delta","index":1,"delta":{"type":"signature_delta","signature":"Es8CCkYICxIM..."}}
810
811event: content_block_stop
812data: {"type":"content_block_stop","index":1}
813
814event: content_block_start
815data: {"type":"content_block_start","index":2,"content_block":{"type":"tool_use","id":"toolu_01D7FLrfh4GYq7yT1ULFeyMV","name":"edit_file","input":{}}}
816```
817
818Under `"updates"`, treat a block as a progress update as soon as one of its `thinking_delta` events carries non-empty text.
819
796820<Note>
797821 When using streaming with thinking enabled, you might notice that text sometimes arrives in larger chunks alternating with smaller, token-by-token delivery. This is expected behavior, especially for thinking content.
798822
from line 842
818842
819843Thinking works alongside [tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview), letting Claude reason through tool selection and process tool results. Two constraints apply:
820844
8211. **Tool choice limitation (manual mode):** tool use with manual extended thinking (`thinking: {type: "enabled"}`) only supports `tool_choice: {"type": "auto"}` (the default) or `tool_choice: {"type": "none"}`. Using `tool_choice: {"type": "any"}` or `tool_choice: {"type": "tool", "name": "..."}` results in an error because these options force tool use, which is incompatible with manual extended thinking. Adaptive thinking, including on models where thinking is on by default, supports forced tool use.
8451. **Tool choice limitation (manual mode):** tool use with manual extended thinking (`thinking: {type: "enabled"}`) only supports `tool_choice: {"type": "auto"}` (the default) or `tool_choice: {"type": "none"}`. Using `tool_choice: {"type": "any"}` or `tool_choice: {"type": "tool", "name": "..."}` results in an error because these options force tool use, which is incompatible with manual extended thinking. Adaptive thinking, including on models where thinking is on by default, supports forced tool use, except on Claude Fable 5.1 and Claude Mythos 5.1 (see [Response prefill and forced tool use](https://platform.claude.com/docs/en/build-with-claude/thinking#limits-and-feature-compatibility)).
8228462. **Preserving thinking blocks:** when you return tool results, you must pass the thinking blocks from the assistant message back to the API, complete and unmodified. See [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks).
823847
824848**A tool-use loop is one assistant turn.** From the model's perspective, an assistant turn doesn't complete until Claude finishes its full response, which may include multiple tool calls and results. This whole sequence is a single assistant turn:
from line 906
882906 Consecutive tool calls do not require interleaved thinking. Claude can chain tool calls with or without interleaved thinking. Interleaving changes where thinking blocks appear between tool calls, not whether tool calls can chain.
883907</Note>
884908
885With adaptive thinking, interleaved thinking is automatic on every model that supports adaptive thinking. No beta header is needed. On Claude Fable 5, Claude Mythos 5, Claude Mythos Preview, Claude Opus 5, Claude Opus 4.8, and Claude Opus 4.7, reasoning between tool calls always appears in thinking blocks. Claude Haiku 4.5 does not support interleaved thinking. On models using manual extended thinking, interleaving requires a beta header and changes how the thinking budget is counted. [Interleaved thinking in manual mode](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#interleaved-thinking) covers the per-model rules and platform-specific header behavior.
909With adaptive thinking, interleaved thinking is automatic on every model that supports adaptive thinking. No beta header is needed. On Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude Mythos Preview, Claude Opus 5, Claude Opus 4.8, and Claude Opus 4.7, reasoning between tool calls always appears in thinking blocks. Claude Haiku 4.5 does not support interleaved thinking. On models using manual extended thinking, interleaving requires a beta header and changes how the thinking budget is counted. [Interleaved thinking in manual mode](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#interleaved-thinking) covers the per-model rules and platform-specific header behavior.
886910
887911With interleaved thinking, the thinking allocation can span the entire assistant turn rather than a single response. Interleaved thinking is only supported for [tools used through the Messages API](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview).
888912
889913For a worked comparison showing what interleaved thinking changes in a two-tool workflow, see [How interleaved thinking changes the flow](https://platform.claude.com/docs/en/build-with-claude/thinking-tool-workflows#how-interleaved-thinking-changes-the-flow).
890914
915### Progress updates between tool calls
916
917On Claude Fable 5.1, Claude Mythos 5.1, and Claude Fable 5, the model can write a progress update between tool calls. A progress update is a sentence or two on what the model just found and what it's about to do next, written for the person watching the agent rather than as reasoning. Each one comes back as its own `thinking` block with its own `signature`, separate from any reasoning block at the same point. It sits immediately before the `tool_use` or `server_tool_use` block it introduces. At most one progress update precedes each tool call, and the model can skip any of them. Progress updates aren't [interleaved thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#interleaved-thinking): they appear whether or not reasoning blocks appear between tool calls, and a response can contain both.
918
919What a progress-update block contains depends on [`display`](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display):
920
921| `display` | Reasoning blocks | Progress-update blocks |
922| ----------------------------------------- | ---------------------- | -------------------------------------------------------- |
923| `"omitted"` (the default on these models) | Empty `thinking` field | Empty `thinking` field |
924| `"updates"` (beta) | Empty `thinking` field | Summary text |
925| `"summarized"` | Summary text | Summary text, not distinguishable from a reasoning block |
926
927Use `display: "updates"` for an agent interface that keeps reasoning hidden and shows the user a status line at each step. Under it, any `thinking` block with non-empty text is a progress update, so render those and nothing else. It's in beta and requires the beta header `thinking-display-updates-2026-08-18` (on Amazon Bedrock, Google Cloud, and Microsoft Foundry, pass the beta value as described in [Beta headers](https://platform.claude.com/docs/en/api/beta-headers)). Without it, the value is rejected with the same 400 `invalid_request_error` as an unknown `display` value.
928
929```json
930{
931 "model": "claude-fable-5-1",
932 "max_tokens": 16000,
933 "thinking": { "type": "adaptive", "display": "updates" },
934 "tools": [
935 {
936 "name": "edit_file",
937 "description": "Replace the contents of a file in the repository.",
938 "input_schema": {
939 "type": "object",
940 "properties": {
941 "path": { "type": "string" },
942 "content": { "type": "string" }
943 },
944 "required": ["path", "content"]
945 }
946 }
947 ],
948 "messages": [
949 {
950 "role": "user",
951 "content": "The login test fails after an hour of uptime. Find out why and fix it."
952 }
953 ]
954}
955```
956
957Under `"updates"`, the start of the response that follows a `tool_result` looks like this. The first block is reasoning and stays empty, as it would under `"omitted"`. The second carries text, so it's a progress update. Under `"summarized"` both blocks carry text, and under `"omitted"` both are empty.
958
959```json Output
960{
961 "content": [
962 {
963 "type": "thinking",
964 "thinking": "",
965 "signature": "EqMBCkYICxIM..."
966 },
967 {
968 "type": "thinking",
969 "thinking": "Confirmed the retry path never refreshes the expired token. Editing auth.py to add the refresh call.",
970 "signature": "Es8CCkYICxIM..."
971 },
972 {
973 "type": "tool_use",
974 "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
975 "name": "edit_file",
976 "input": { "path": "auth.py", "content": "..." }
977 }
978 ]
979}
980```
981
982Keep the following in mind when working with progress updates:
983
984* Pass progress-update blocks back unchanged with the rest of the assistant turn, like any other `thinking` block.
985* The text you receive is a summary of the progress update, normally a sentence or two. Don't rely on its length. The progress update counts toward `usage.output_tokens` at its full length, not the summary's.
986* A progress-update block can come back with an empty `thinking` field under any `display` value. Render nothing for an empty block. Under `"updates"` it looks the same as an empty reasoning block and needs no separate handling.
987* When a response stops on `max_tokens`, `model_context_window_exceeded`, or `stop_sequence` soon after a tool call or tool result, its last block can be a progress-update block standing in for the work the model hadn't finished. Under `"updates"` and `"summarized"` its text is exactly `This part of the response was interrupted before it finished.` and you can show it like any other update. Under `"omitted"` it's empty. To continue, pass the assistant turn back unchanged and append a new `user` message (with a `tool_result` for each `tool_use` block in that turn).
988* When [streaming](https://platform.claude.com/docs/en/build-with-claude/thinking#streaming-thinking), expect a pause of several seconds before a progress-update block opens. See the `"updates"` trace in [Streaming thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#streaming-thinking).
989* These models write fewer progress updates at higher [effort](https://platform.claude.com/docs/en/build-with-claude/effort) and in long tool chains. If your interface depends on them, see [Ask for user-facing progress updates](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#ask-for-user-facing-progress-updates).
990
891991### Thinking block preservation by model
892992
893993Whether thinking blocks from previous assistant turns stay in context by default depends on the model:
894994
895* **Keep all prior turns:** Claude Opus 4.5 and later Opus models, Claude Sonnet 4.6 and later Sonnet models, Claude Fable 5, Claude Mythos 5, and Claude Mythos Preview.
995* **Keep all prior turns:** Claude Opus 4.5 and later Opus models, Claude Sonnet 4.6 and later Sonnet models, Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, and Claude Mythos Preview.
896996* **Keep the last turn only:** earlier Opus and Sonnet models, and all Haiku models through Claude Haiku 4.5. When you pass older thinking blocks back, the API strips them automatically. You don't need to remove them yourself.
897997
898998Preservation brings two benefits:
from line 1002
9021002
9031003The tradeoff is context usage: long conversations consume more context space on keep-all models, because retained thinking blocks count as input like any other conversation history (see [Thinking and the context window](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-and-the-context-window)). The behavior is automatic in both regimes. No code changes or beta headers are required, and you should keep passing complete, unmodified thinking blocks back as described in [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks). To override the default in either direction, use [thinking block clearing](https://platform.claude.com/docs/en/build-with-claude/context-editing#thinking-block-clearing).
9041004
905**Switching models mid-conversation.** When you switch between any two models, for example after a [classifier refusal fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback), strip `thinking` and `redacted_thinking` blocks from prior assistant turns. Thinking blocks are tied to the model that produced them. Other models silently ignore them rather than rejecting the request, but ignored blocks still add input tokens.
1005**Switching models mid-conversation.** Keep passing thinking blocks back unchanged when you switch models, for example after a [classifier refusal fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback). A thinking block is readable only by the model that produced it or a newer one, and the API ignores or drops the blocks the target model can't read. On Claude Fable 5.1 and Claude Mythos 5.1 the direction matters: they read every earlier model's thinking blocks and no earlier model reads theirs, so switching up to them keeps the conversation's reasoning and switching down drops it (see [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-for-model) for the exact list and for how dropped blocks are billed and reported). Strip prior `thinking` and `redacted_thinking` blocks yourself only to save input tokens on models that ignore rather than drop them, and never when redeeming a [fallback credit](https://platform.claude.com/docs/en/build-with-claude/fallback-credit), which requires the body unchanged.
1006
1007## Preserved thinking
1008
1009Claude preserves a thinking block, keeping it usable on later turns, only under the conditions it was created in. Starting with Claude Fable 5.1 and Claude Mythos 5.1, a `thinking` or `redacted_thinking` block is preserved only:
1010
1011* **For the model that produced it, or a newer one.** An earlier model can't use the block, and the API drops it from that request. See [Only for the model that produced it, or a newer one](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-for-model).
1012* **In the conversation that produced it (Claude Fable 5.1 only).** If the `system` prompt, the `tools`, or any earlier message changes, the block is no longer valid, and the API rejects the request or drops the block. See [Only in the conversation that produced it](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-in-conversation).
1013
1014The block's `signature` records both conditions on both models. The API checks it whenever the block comes back in a later request, including a request to a different model; Claude Mythos 5.1 checks only the model condition.
1015
1016**Pass blocks back unchanged.** Send every assistant turn exactly as you received it, thinking blocks included, and let the API decide which blocks the model can use.
1017
1018### Only for the model that produced it, or a newer one
1019
1020This condition is one-way: Claude Fable 5.1 and Claude Mythos 5.1 read earlier models' thinking blocks, and no earlier model reads theirs.
1021
1022* **A conversation that moves onto Claude Fable 5.1 or Claude Mythos 5.1 keeps its reasoning.** The earlier model's thinking blocks stay readable, so the model thinks as usual from the first turn after the switch.
1023* **A conversation that moves from them to any earlier model loses it.** The earlier model can't read their blocks, the API drops them for that request, and the earlier model reasons again from the visible messages. If the conversation later returns to Claude Fable 5.1 with the same history, its own blocks are readable again.
1024
1025In full, Claude Fable 5.1 and Claude Mythos 5.1 read thinking blocks produced by each other, by Claude Opus 5, Claude Fable 5, and Claude Mythos 5, and by Claude Opus 4.8 and earlier Opus models, Claude Sonnet models, and Claude Haiku 4.5. No model other than these two can read a block produced by Claude Fable 5.1 or Claude Mythos 5.1.
1026
1027**A block the receiving model can't read is dropped.** The API removes it before the prompt reaches the model. It doesn't count toward `input_tokens` and isn't billed. When you fall back from Claude Fable 5.1 to an older model mid-conversation, for example after a [classifier refusal fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback), the older model reasons again from the visible conversation. With the [controls beta header](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-thinking-controls) the drop is reported in `input_transformations` as `model_binding_mismatch`. Without it the drop is silent. A [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback) drops unreadable blocks the same way.
1028
1029### Only in the conversation that produced it
1030
1031A thinking block from Claude Fable 5.1 is preserved only while the conversation prefix it was produced from stays unchanged. Its `signature` covers the `system` prompt, the `tools`, and the messages that preceded the block. Claude Mythos 5.1 records the same `signature` but doesn't run this check.
1032
1033This check is enforced for new accounts created on or after August 31, 2026. For accounts created earlier, the API records the condition in the signature but doesn't act on a mismatch unless the request sets [`thinking.block_binding.prefix_mismatch_behavior`](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-thinking-controls), which opts into enforcement. Anthropic plans to enforce this condition for every organization on future models. If your account was created earlier, make your application compatible now: the same append-only patterns keep the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) warm, and you can test against the check by sending `prefix_mismatch_behavior: "error"`. If you ship a tool or framework that people run with their own API key, test that way: your users on new accounts are enforced before you are. [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking) has the integration checklist: how to tell whether your code edits history, and the API feature that replaces each kind of edit.
1034
1035Where the check is enforced, a request that replays a block against a changed prefix is rejected with a 400 `invalid_request_error`:
1036
1037```text wrap
1038messages.5.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Remove the block, or set `thinking.block_binding.prefix_mismatch_behavior` to "drop_block". That setting requires the `thinking-binding-controls-2026-08-01` value in the `anthropic-beta` header.
1039```
1040
1041The last sentence appears only when the request didn't send the beta header. The message can end with one more sentence naming the first message that changed. Retrying the same request body fails the same way. To continue without the invalidated reasoning instead, send the `thinking-binding-controls-2026-08-01` beta header and set `prefix_mismatch_behavior` to `"drop_block"`. The API then drops the failing block and every thinking block after it in the conversation, and reports each one in `input_transformations` as `prefix_binding_mismatch`. The [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) endpoint runs the same check and returns the same 400.
1042
1043What invalidates later thinking blocks:
1044
1045* Editing, reordering, or removing an earlier message, including removing a per-turn reminder you injected into an earlier user turn.
1046* Changing the content of the top-level `system` prompt, or adding, removing, or editing a tool in the `tools` array, between requests.
1047* Client-side compaction or truncation that keeps recent assistant turns verbatim, thinking included, while rewriting the turns before them.
1048* An image or document URL in an earlier turn that serves different bytes on a later request. The check covers the bytes, not the URL string, so a rotating signed URL for the same file is fine. For content you reference across turns, upload it once with the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) and send the `file_id`, or send base64.
1049
1050What doesn't:
1051
1052* Removing a leading run of thinking blocks, oldest first: the first thinking block in the conversation (or the first one after the most recent compaction block), then the next, and so on. Removing a thinking block from anywhere else invalidates every thinking block after it, in that turn and in every later turn.
1053* Changing `output_config.effort`, `max_tokens`, or other sampling settings between requests.
1054* `cache_control` markers, wherever you place or move them.
1055* Server-side [compaction](https://platform.claude.com/docs/en/build-with-claude/compaction) and [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing): they don't count as edits, because the check compares the conversation as you sent it, not the server's edited copy. After a compaction, the checked prefix starts from the compaction block.
1056
1057Patterns that keep thinking blocks valid:
1058
1059* **Append only.** Add new messages at the end of `messages` and leave earlier turns byte-for-byte unchanged.
1060* **Use [mid-conversation system messages](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages)** and mid-conversation tool changes to add instructions or change tool availability partway through, instead of editing the top-level `system` field or `tools` array. For a reminder that should apply to one turn only, send it as a [turn-scoped system message](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages#turn-scoped-system-messages) and leave it in the history rather than deleting it later. This also preserves the prompt cache.
1061* **Use server-side context management** rather than trimming history yourself.
1062* **If a request is rejected for a prefix mismatch and you can't repair the history,** resend it with the beta header and `prefix_mismatch_behavior: "drop_block"`, or strip every `thinking` and `redacted_thinking` block from the history and retry once.
1063
1064When earlier thinking is dropped, the model answers that turn without those blocks. A client that repeatedly invalidates its own history restarts the prompt cache each time, which raises cost.
1065
1066**Client-side compaction.** This check doesn't rule out compacting on the client. The rule is narrower: don't keep a thinking block behind a prefix you've rewritten. Server-side [compaction](https://platform.claude.com/docs/en/build-with-claude/compaction) is the simplest way to satisfy it. If you compact on the client, use one of these shapes:
1067
1068* **Simple compaction (recommended):** summarize the conversation into one message and start the next request with that summary plus the new user turn, replaying no earlier turns and no earlier thinking blocks. No earlier thinking remains, so nothing fails, and the model thinks afresh on the compacted conversation. Claude models are trained on long-horizon tasks with this scheme, and it performs comparably to more elaborate ones for most workloads. It resets the prompt cache, as any compaction does.
1069* **Keep-tail compaction:** summarize older turns and keep the most recent turns verbatim. The kept turns' thinking blocks were produced against the full history and fail behind the summary. Strip `thinking` and `redacted_thinking` from every turn you carry across (their text and tool calls can stay), or set `prefix_mismatch_behavior: "drop_block"` and let the API discard them.
1070* **Background compaction:** build the summary off the critical path and swap it in while the conversation continues. Every turn produced in the meantime has thinking that predates the swap. Send `"drop_block"` on every request that still carries thinking blocks produced before the swap (or strip those blocks yourself; `input_transformations` on the first response after the swap lists exactly which ones), or compact synchronously.
1071
1072Snipping individual turns out of the middle of the transcript invalidates every thinking block after them, and no client-side shape avoids that. Use a mid-conversation system message for the instruction change you were making, or server-side [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) for selective removal.
1073
1074### Controls for blocks that aren't preserved (beta)
1075
1076Send the [beta header](https://platform.claude.com/docs/en/api/beta-headers) `thinking-binding-controls-2026-08-01` to get two things: an `input_transformations` array on every response that lists any thinking blocks the API dropped, and a `block_binding` object on the thinking configuration with one field.
1077
1078| Field | Type | Default | Description |
1079| -------------------------- | --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1080| `prefix_mismatch_behavior` | `"error"` or `"drop_block"` | `"error"` | What the API does with a thinking block that fails the [conversation check](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-in-conversation). `"error"` rejects the request with a 400 error. `"drop_block"` removes the block and every later thinking block in the conversation, reports each in `input_transformations`, and continues. Neither value changes the model check, which always drops. |
1081
1082`block_binding` is accepted alongside `thinking.type: "adaptive"` and `thinking.type: "enabled"`. Sending it without the beta header returns a 400 error. Models that don't run the conversation check accept the object and report only model-check drops, so one request body works across models. On Amazon Bedrock and Google Cloud, pass beta names as described in [Beta headers](https://platform.claude.com/docs/en/api/beta-headers).
1083
1084The following request opts into dropping rather than rejecting. On a first turn there is nothing to replay, so `input_transformations` comes back empty:
1085
1086<CodeGroup>
1087 ```bash cURL
1088 curl https://api.anthropic.com/v1/messages \
1089 -H "x-api-key: $ANTHROPIC_API_KEY" \
1090 -H "anthropic-version: 2023-06-01" \
1091 -H "anthropic-beta: thinking-binding-controls-2026-08-01" \
1092 -H "content-type: application/json" \
1093 -d '{
1094 "model": "claude-fable-5-1",
1095 "max_tokens": 16000,
1096 "thinking": {
1097 "type": "adaptive",
1098 "block_binding": {
1099 "prefix_mismatch_behavior": "drop_block"
1100 }
1101 },
1102 "messages": [
1103 {
1104 "role": "user",
1105 "content": "What is the greatest common divisor of 1071 and 462?"
1106 }
1107 ]
1108 }'
1109 ```
1110
1111 ```bash CLI
1112 ant beta:messages create --beta thinking-binding-controls-2026-08-01 \
1113 --transform '{content.#(type=="text")#.text,input_transformations}' \
1114 --format yaml <<'YAML'
1115 model: claude-fable-5-1
1116 max_tokens: 16000
1117 thinking:
1118 type: adaptive
1119 block_binding:
1120 prefix_mismatch_behavior: drop_block
1121 messages:
1122 - role: user
1123 content: What is the greatest common divisor of 1071 and 462?
1124 YAML
1125 ```
1126
1127 ```python Python
1128 client = anthropic.Anthropic()
1129
1130 response = client.beta.messages.create(
1131 model="claude-fable-5-1",
1132 max_tokens=16000,
1133 thinking={
1134 "type": "adaptive",
1135 "block_binding": {"prefix_mismatch_behavior": "drop_block"},
1136 },
1137 messages=[
1138 {
1139 "role": "user",
1140 "content": "What is the greatest common divisor of 1071 and 462?",
1141 }
1142 ],
1143 betas=["thinking-binding-controls-2026-08-01"],
1144 )
1145
1146 for block in response.content:
1147 if block.type == "text":
1148 print(block.text)
1149
1150 print(f"Input transformations: {len(response.input_transformations or [])}")
1151 ```
1152
1153 ```typescript TypeScript
1154 const client = new Anthropic();
1155
1156 const response = await client.beta.messages.create({
1157 model: "claude-fable-5-1",
1158 max_tokens: 16000,
1159 thinking: {
1160 type: "adaptive",
1161 block_binding: { prefix_mismatch_behavior: "drop_block" }
1162 },
1163 messages: [
1164 { role: "user", content: "What is the greatest common divisor of 1071 and 462?" }
1165 ],
1166 betas: ["thinking-binding-controls-2026-08-01"]
1167 });
1168
1169 for (const block of response.content) {
1170 if (block.type === "text") {
1171 console.log(block.text);
1172 }
1173 }
1174 console.log(`Input transformations: ${response.input_transformations?.length ?? 0}`);
1175 ```
1176
1177 ```csharp C#
1178
1179 AnthropicClient client = new();
1180
1181 var response = await client.Beta.Messages.Create(
1182 new()
1183 {
1184 Model = "claude-fable-5-1",
1185 MaxTokens = 16000,
1186 Thinking = new BetaThinkingConfigAdaptive
1187 {
1188 BlockBinding = new()
1189 {
1190 PrefixMismatchBehavior = BetaThinkingPrefixMismatchBehavior.DropBlock,
1191 },
1192 },
1193 Messages =
1194 [
1195 new()
1196 {
1197 Role = Role.User,
1198 Content = "What is the greatest common divisor of 1071 and 462?",
1199 },
1200 ],
1201 Betas = [AnthropicBeta.ThinkingBindingControls2026_08_01],
1202 }
1203 );
1204
1205 foreach (var block in response.Content)
1206 {
1207 if (block.TryPickText(out var textBlock))
1208 {
1209 Console.WriteLine(textBlock.Text);
1210 }
1211 }
1212
1213 Console.WriteLine($"Input transformations: {response.InputTransformations?.Count ?? 0}");
1214 ```
1215
1216 ```go Go
1217 client := anthropic.NewClient()
1218
1219 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
1220 Model: "claude-fable-5-1",
1221 MaxTokens: 16000,
1222 Thinking: anthropic.BetaThinkingConfigParamUnion{
1223 OfAdaptive: &anthropic.BetaThinkingConfigAdaptiveParam{
1224 BlockBinding: anthropic.BetaThinkingBlockBindingParam{
1225 PrefixMismatchBehavior: anthropic.BetaThinkingPrefixMismatchBehaviorDropBlock,
1226 },
1227 },
1228 },
1229 Messages: []anthropic.BetaMessageParam{
1230 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("What is the greatest common divisor of 1071 and 462?")),
1231 },
1232 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaThinkingBindingControls2026_08_01},
1233 })
1234 if err != nil {
1235 log.Fatal(err)
1236 }
1237
1238 for _, block := range response.Content {
1239 if textBlock, ok := block.AsAny().(anthropic.BetaTextBlock); ok {
1240 fmt.Println(textBlock.Text)
1241 }
1242 }
1243 fmt.Printf("Input transformations: %d\n", len(response.InputTransformations))
1244 ```
1245
1246 ```java Java
1247 import com.anthropic.models.beta.AnthropicBeta;
1248 import com.anthropic.models.beta.messages.BetaMessage;
1249 import com.anthropic.models.beta.messages.BetaThinkingBlockBinding;
1250 import com.anthropic.models.beta.messages.BetaThinkingConfigAdaptive;
1251 import com.anthropic.models.beta.messages.BetaThinkingPrefixMismatchBehavior;
1252 import com.anthropic.models.beta.messages.MessageCreateParams;
1253
1254 void main() {
1255 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1256
1257 MessageCreateParams params = MessageCreateParams.builder()
1258 .model("claude-fable-5-1")
1259 .maxTokens(16000L)
1260 .addBeta(AnthropicBeta.THINKING_BINDING_CONTROLS_2026_08_01)
1261 .thinking(BetaThinkingConfigAdaptive.builder()
1262 .blockBinding(BetaThinkingBlockBinding.builder()
1263 .prefixMismatchBehavior(BetaThinkingPrefixMismatchBehavior.DROP_BLOCK)
1264 .build())
1265 .build())
1266 .addUserMessage("What is the greatest common divisor of 1071 and 462?")
1267 .build();
1268
1269 BetaMessage response = client.beta().messages().create(params);
1270
1271 response.content().stream()
1272 .flatMap(block -> block.text().stream())
1273 .forEach(textBlock -> IO.println(textBlock.text()));
1274 IO.println("Input transformations: "
1275 + response.inputTransformations().map(List::size).orElse(0));
1276 }
1277 ```
1278
1279 ```php PHP
1280 use Anthropic\Beta\AnthropicBeta;
1281 use Anthropic\Beta\Messages\BetaThinkingBlockBinding;
1282 use Anthropic\Beta\Messages\BetaThinkingConfigAdaptive;
1283 use Anthropic\Beta\Messages\BetaThinkingPrefixMismatchBehavior;
1284 use Anthropic\Client;
1285
1286 $client = new Client();
1287
1288 $response = $client->beta->messages->create(
1289 model: 'claude-fable-5-1',
1290 maxTokens: 16000,
1291 thinking: BetaThinkingConfigAdaptive::with(
1292 blockBinding: BetaThinkingBlockBinding::with(
1293 prefixMismatchBehavior: BetaThinkingPrefixMismatchBehavior::DROP_BLOCK,
1294 ),
1295 ),
1296 messages: [
1297 ['role' => 'user', 'content' => 'What is the greatest common divisor of 1071 and 462?'],
1298 ],
1299 betas: [AnthropicBeta::THINKING_BINDING_CONTROLS_2026_08_01],
1300 );
1301
1302 foreach ($response->content as $block) {
1303 if ($block->type === 'text') {
1304 echo $block->text, PHP_EOL;
1305 }
1306 }
1307
1308 echo 'Input transformations: ', count($response->inputTransformations ?? []), PHP_EOL;
1309 ```
1310
1311 ```ruby Ruby
1312 client = Anthropic::Client.new
1313
1314 response = client.beta.messages.create(
1315 model: "claude-fable-5-1",
1316 max_tokens: 16_000,
1317 thinking: {
1318 type: "adaptive",
1319 block_binding: {prefix_mismatch_behavior: "drop_block"}
1320 },
1321 messages: [
1322 {role: "user", content: "What is the greatest common divisor of 1071 and 462?"}
1323 ],
1324 betas: [Anthropic::AnthropicBeta::THINKING_BINDING_CONTROLS_2026_08_01]
1325 )
1326
1327 response.content.each do |block|
1328 puts block.text if block.type == :text
1329 end
1330
1331 puts "Input transformations: #{response.input_transformations&.length || 0}"
1332 ```
1333</CodeGroup>
1334
1335```text Output wrap
1336The greatest common divisor of 1071 and 462 is 21.
1337Input transformations: 0
1338```
1339
1340**Dropped blocks are reported in `input_transformations`.** Under the beta header, every response from a thinking-capable model carries this top-level array. It's empty when nothing was dropped and never `null`. Each entry names the position of a dropped block and the check it failed:
1341
1342```json
1343{
1344 "input_transformations": [
1345 {
1346 "type": "thinking_dropped",
1347 "path": "messages.1.content.0",
1348 "reason": "model_binding_mismatch"
1349 }
1350 ]
1351}
1352```
1353
1354The `reason` field is `model_binding_mismatch` or `prefix_binding_mismatch`. Ignore entries whose `type` or `reason` you don't recognize, because later checks add values. When [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming), `input_transformations` arrives on the `message` object in the `message_start` event. After a mid-stream server-side fallback, the final `message_delta` event carries the array again with the serving model's entries. Without the beta header the field is absent.
1355
1356A tampered or undecryptable signature is a different failure: it always returns a 400 (``Invalid `signature` in `thinking` block``, with no reason clause) and `prefix_mismatch_behavior` doesn't apply to it. In a [message batch](https://platform.claude.com/docs/en/build-with-claude/batch-processing), an item whose block fails the conversation check under `"error"` resolves as `errored`.
9061357
9071358## Thinking and prompt caching
9081359
9091360[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) interacts with thinking in a few specific ways. The following rules apply in both thinking modes.
9101361
911**Configuration changes invalidate caching.** The thinking configuration and the resolved [`effort`](https://platform.claude.com/docs/en/build-with-claude/effort) level are rendered into the prompt itself, so changing any of them starts a new cache prefix. Switching between `adaptive`, `enabled`, and `disabled`, changing `budget_tokens`, and changing the effort value all invalidate cache breakpoints: message-level breakpoints always miss, and tool and system-prompt breakpoints can miss too, depending on where the model renders the configuration. Treat any thinking or effort change as starting the cache over. Consecutive requests that keep the same configuration preserve the cache, and setting a parameter explicitly to its default value is equivalent to omitting it. A worked demonstration with usage output is on the [Steering thinking](https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost#prompt-caching) page.
1362**Configuration changes invalidate caching.** The thinking configuration and the resolved [`effort`](https://platform.claude.com/docs/en/build-with-claude/effort) level are rendered into the prompt itself, so changing any of them starts a new cache prefix. Switching between `adaptive`, `enabled`, and `disabled`, changing `budget_tokens`, and changing the effort value all invalidate cache breakpoints: message-level breakpoints always miss, and tool and system-prompt breakpoints can miss too, depending on where the model renders the configuration. Treat any thinking or top-level effort change as starting the cache over. On models that support [per-message effort](https://platform.claude.com/docs/en/build-with-claude/effort#change-effort-mid-conversation-beta), an effort change carried in a `role: "system"` message inside `messages` leaves the cached prefix intact. Consecutive requests that keep the same configuration preserve the cache, and setting a parameter explicitly to its default value is equivalent to omitting it. A thinking block the API drops under either [preserved-thinking condition](https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-thinking) changes the cached prefix from that block's position onward. Blocks passed back unchanged keep the cache intact. A worked demonstration with usage output is on the [Steering thinking](https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost#prompt-caching) page.
9121363
9131364**Thinking blocks are cached with tool results.** During a tool-use loop, caching occurs when you make a follow-up request that includes tool results. At that point the previous conversation history, including its thinking blocks, can be cached, and those cached thinking blocks count as input tokens in your usage metrics when read from the cache. This occurs automatically, even without explicit `cache_control` markers, and behaves the same for regular and interleaved thinking. The tradeoff: thinking blocks you never see again in responses still contribute to input token usage when read from cache.
9141365
from line 1449
9981449 `redacted_thinking` blocks are a distinct content block type returned when thinking is safety-redacted. This is separate from the [`display: "omitted"`](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display) option, which returns regular `thinking` blocks with an empty `thinking` field.
9991450</Note>
10001451
1001## Thinking output on Claude Fable 5 and Claude Mythos 5
1002
1003On Claude Fable 5 and Claude Mythos 5, the raw chain of thought is never returned. The blocks you receive are regular `thinking` blocks, not `redacted_thinking`, and the [`display` setting](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display) works the same as on other models ([summarized](https://platform.claude.com/docs/en/build-with-claude/thinking#summarized-thinking) text, or an empty `thinking` field when omitted, the default here). For the response shape of thinking blocks, see the [Messages API reference](https://platform.claude.com/docs/en/api/messages/create).
1004
1005When continuing a conversation on the same model, pass each thinking block back to the API exactly as received, including blocks whose `thinking` field is empty. Don't edit or reconstruct them. Reading the summary text for display is fine: the API rejects blocks whose returned content has been modified, not blocks you have read. Text placed in an empty omitted `thinking` field is [ignored rather than rejected](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display).
1006
1007To learn how thinking blocks are handled when you switch models mid-conversation, see [Thinking block preservation by model](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-block-preservation-by-model).
1008
1009Two exceptions, covered in [Fallback credit](https://platform.claude.com/docs/en/build-with-claude/fallback-credit):
1010
1011* Fallback-credit retries must echo the refused request body unchanged.
1012* `fallback` blocks from a mid-output fallback stay where they appeared.
1013
1014To get visibility into the model's reasoning, read the `thinking` blocks described on this page rather than prompting for reasoning in the response text. On Claude Fable 5, a request that attempts to elicit the model's internal reasoning as part of the response text can be refused with `stop_details.category: "reasoning_extraction"`. See [Refusal categories](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response) for the field reference and handling guidance.
1015
10161452## Limits and feature compatibility
10171453
1018**Sampling parameters.** On Claude Fable 5, Claude Mythos 5, Claude Mythos Preview, Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, and Claude Sonnet 5, non-default `temperature`, `top_p`, or `top_k` values return a 400 error on every request, regardless of whether thinking is used. On older models, the restriction applies only while thinking is on: `temperature` and `top_k` are incompatible with thinking, and `top_p` is allowed at values between 0.95 and 1.
1019
1020**Response prefill and forced tool use.** You can't pre-fill the assistant response while thinking is on. Forced tool use (`tool_choice: {"type": "any"}` or `{"type": "tool", ...}`) is incompatible with manual extended thinking but works with adaptive thinking. See [Thinking with tool use](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-with-tool-use).
1021
1022**Output limits.** Claude Fable 5, Claude Mythos 5, Claude Mythos Preview, Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, Claude Sonnet 5, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 128k output tokens per request. Claude Haiku 4.5, Claude Sonnet 4.5, and Claude Opus 4.5 support up to 64k. On the [Message Batches API](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta), the `output-300k-2026-03-24` [beta header](https://platform.claude.com/docs/en/api/beta-headers) raises the limit to 300k for Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, Claude Sonnet 5, Claude Opus 4.6, and Claude Sonnet 4.6. See each model's page under [Models](https://platform.claude.com/docs/en/models/overview) for its limits.
1023
1024**Long requests.** The SDKs require streaming when `max_tokens` is greater than 21,333, to avoid HTTP timeouts on long-running requests. This is a client-side validation, not an API restriction. If you don't need to process events incrementally, use `.stream()` with `.get_final_message()` (Python) or `.finalMessage()` (TypeScript) to get the complete `Message` object without handling individual events. See [Streaming Messages](https://platform.claude.com/docs/en/build-with-claude/streaming#get-the-final-message-without-handling-events). Expect longer response times when thinking is active, because generating thinking blocks adds processing time. For workloads that push thinking above roughly 32k tokens per request, use [batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) to avoid networking issues: such requests can run long enough to hit system timeouts and open connection limits.
1454### Sampling parameters
1455
1456On Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude Mythos Preview, Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, and Claude Sonnet 5, non-default `temperature`, `top_p`, or `top_k` values return a 400 error on every request, regardless of whether thinking is used. On older models, the restriction applies only while thinking is on: `temperature` and `top_k` are incompatible with thinking, and `top_p` is allowed at values between 0.95 and 1.
1457
1458### Response prefill and forced tool use
1459
1460You can't prefill the assistant response while thinking is on. Forced tool use (`tool_choice: {"type": "any"}` or `{"type": "tool", ...}`) is incompatible with manual extended thinking but works with adaptive thinking. The exceptions are Claude Fable 5.1 and Claude Mythos 5.1, which reject forced tool use on every request with a 400 error. On those models, use `tool_choice: {"type": "auto"}` with [strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use) or [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) instead. See [Thinking with tool use](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-with-tool-use).
1461
1462### Output limits
1463
1464Each model accepts `max_tokens` up to the ceiling listed here. On the [Message Batches API](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta), the `output-300k-2026-03-24` [beta header](https://platform.claude.com/docs/en/api/beta-headers) raises that ceiling for the models with a batches ceiling listed.
1465
1466| Model | Max output tokens | Batches beta ceiling |
1467| --------------------- | ----------------- | -------------------- |
1468| Claude Fable 5.1 | 128k | — |
1469| Claude Mythos 5.1 | 128k | — |
1470| Claude Fable 5 | 128k | — |
1471| Claude Mythos 5 | 128k | — |
1472| Claude Mythos Preview | 128k | Not available |
1473| Claude Opus 5 | 128k | 300k |
1474| Claude Opus 4.8 | 128k | 300k |
1475| Claude Opus 4.7 | 128k | 300k |
1476| Claude Sonnet 5 | 128k | 300k |
1477| Claude Opus 4.6 | 128k | 300k |
1478| Claude Sonnet 4.6 | 128k | 300k |
1479| Claude Haiku 4.5 | 64k | Not available |
1480| Claude Sonnet 4.5 | 64k | Not available |
1481| Claude Opus 4.5 | 64k | Not available |
1482
1483See the [models overview](https://platform.claude.com/docs/en/models/overview) for limits on legacy models.
1484
1485### Long requests
1486
1487The SDKs require streaming when `max_tokens` is greater than 21,333, to avoid HTTP timeouts on long-running requests. This is a client-side validation, not an API restriction. If you don't need to process events incrementally, use `.stream()` with `.get_final_message()` (Python) or `.finalMessage()` (TypeScript) to get the complete `Message` object without handling individual events. See [Streaming Messages](https://platform.claude.com/docs/en/build-with-claude/streaming#get-the-final-message-without-handling-events). Expect longer response times when thinking is active, because generating thinking blocks adds processing time. For workloads that push thinking above roughly 32k tokens per request, use [batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing) to avoid networking issues: such requests can run long enough to hit system timeouts and open connection limits.
10251488
10261489## Next steps
10271490
from line 1497
10341497 Walk through a complete two-turn tool-use round trip that preserves thinking blocks correctly, and see how interleaved thinking changes the flow.
10351498 </Card>
10361499
1500 <Card title="Preserved thinking" icon="stack" href="https://platform.claude.com/docs/en/build-with-claude/preserved-thinking">
1501 Find out whether your Messages API integration edits conversation history, and replace each edit with the API feature that keeps earlier thinking blocks valid.
1502 </Card>
1503
10371504 <Card title="Troubleshooting thinking" icon="hammer" href="https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting">
10381505 Diagnose and fix the most common thinking failures: configuration 400 errors, empty or missing thinking blocks, max\_tokens stops, and cache misses.
10391506 </Card>
10401507