This feature is eligible for Zero Data Retention (ZDR). When your organization has a ZDR arrangement, data sent through this feature is not stored after the API response is returned.
適応的思考は、Claude Opus 4.7、Claude Opus 4.6、Claude Sonnet 4.6 で拡張思考を使用する推奨方法であり、Claude Mythos Preview のデフォルトモードです(thinking が設定されていない場合は自動的に適用されます)。思考トークン予算を手動で設定する代わりに、適応的思考により Claude は各リクエストの複雑さに基づいて拡張思考をいつ、どの程度使用するかを動的に決定できます。Claude Opus 4.7 では、適応的思考は唯一サポートされている思考モードです。手動の thinking: {type: "enabled", budget_tokens: N} はもはや受け入れられません。
適応的思考は、特に二峰性タスクと長期的なエージェント的ワークフローなど、多くのワークロードで固定 budget_tokens を使用した拡張思考よりも優れたパフォーマンスを提供できます。ベータヘッダーは必要ありません。
ワークロードが予測可能なレイテンシーまたは思考コストの正確な制御を必要とする場合、Claude Opus 4.6 と Claude Sonnet 4.6 では budget_tokens を使用した拡張思考は依然として機能していますが、非推奨であり、もはや推奨されていません。以下の警告を参照してください。
適応的思考は以下のモデルでサポートされています:
claude-mythos-preview)、適応的思考がデフォルトです。thinking: {type: "disabled"} はサポートされていませんclaude-opus-4-7)、適応的思考は唯一サポートされている思考モードです。リクエストで明示的に thinking: {type: "adaptive"} を設定しない限り、思考はオフです。手動の thinking: {type: "enabled"} は 400 エラーで拒否されます。claude-opus-4-6)claude-sonnet-4-6)thinking.type: "enabled" と budget_tokens は Opus 4.6 と Sonnet 4.6 で非推奨であり、将来のモデルリリースで削除されます。代わりに thinking.type: "adaptive" を effort パラメータと共に使用してください。既存の budget_tokens 設定は依然として機能していますが、もはや推奨されていません。移行を計画してください。
古いモデル(Sonnet 4.5、Opus 4.5 など)は適応的思考をサポートしておらず、thinking.type: "enabled" と budget_tokens が必要です。
適応モードでは、思考はモデルにとってオプションです。Claude は各リクエストの複雑さを評価し、拡張思考を使用するかどうか、どの程度使用するかを決定します。デフォルトの努力レベル(high)では、Claude はほぼ常に思考します。より低い努力レベルでは、Claude はより単純な問題については思考をスキップする可能性があります。
適応的思考はインターリーブ思考も自動的に有効にします。これは Claude がツール呼び出し間で思考できることを意味し、エージェント的ワークフローに特に効果的です。
API リクエストで thinking.type を "adaptive" に設定します:
適応的思考を努力パラメータと組み合わせて、Claude がどの程度思考するかをガイドできます。努力レベルは Claude の思考配分に対するソフトガイダンスとして機能します:
| 努力レベル | 思考動作 |
|---|---|
max | Claude は思考深度に制約なく常に思考します。Claude Mythos Preview、Claude Opus 4.7、Claude Opus 4.6、Claude Sonnet 4.6 で利用可能です。 |
xhigh | Claude は深く広範な探索を伴って常に思考します。Claude Opus 4.7 で利用可能です。 |
high(デフォルト) | Claude は常に思考します。複雑なタスクに対して深い推論を提供します。 |
medium | Claude は中程度の思考を使用します。非常に単純なクエリについては思考をスキップする可能性があります。 |
low | Claude は思考を最小化します。速度が最も重要な単純なタスクについては思考をスキップします。 |
適応的思考はストリーミングとシームレスに機能します。思考ブロックは手動思考モードと同じように thinking_delta イベント経由でストリーミングされます:
| モード | 設定 | 利用可能性 | 使用時期 |
|---|---|---|---|
| 適応的 | thinking: {type: "adaptive"} | Claude Mythos Preview(デフォルト)、Opus 4.7(唯一のモード)、Opus 4.6、Sonnet 4.6 | Claude が拡張思考をいつ、どの程度使用するかを決定します。effort を使用してガイドします。 |
| 手動 | thinking: {type: "enabled", budget_tokens: N} | Claude Opus 4.7 を除くすべてのモデル(拒否されます)。Opus 4.6 と Sonnet 4.6 では非推奨(代わりに適応モードを検討してください)。 | 思考トークン支出を正確に制御する必要がある場合。 |
| 無効化 | thinking パラメータを省略するか、{type: "disabled"} を渡す | Claude Mythos Preview を除くすべてのモデル | 拡張思考が不要で、最も低いレイテンシーが必要な場合。 |
適応的思考は Claude Mythos Preview、Claude Opus 4.7、Opus 4.6、Sonnet 4.6 で利用可能です。Mythos Preview では、適応的思考がデフォルトであり、thinking が設定されていない場合は自動的に適用されます。Claude Opus 4.7 では、適応的思考は唯一サポートされているモードであり、budget_tokens を使用した type: "enabled" は拒否されます。古いモデルは budget_tokens を使用した type: "enabled" のみをサポートしています。Opus 4.6 と Sonnet 4.6 では、budget_tokens を使用した type: "enabled" は依然として機能していますが、非推奨です。
モード別インターリーブ思考の利用可能性:
interleaved-thinking-2025-05-14 ベータヘッダー経由で機能します。適応的思考を使用する場合、以前のアシスタント ターンは思考ブロックで開始する必要がありません。これは手動モードよりも柔軟です。手動モードでは、API は思考が有効なターンが思考ブロックで開始することを強制します。
adaptive 思考を使用した連続リクエストはプロンプトキャッシュブレークポイントを保持します。ただし、adaptive と enabled/disabled 思考モード間で切り替えると、メッセージのキャッシュブレークポイントが破損します。システムプロンプトとツール定義は、モード変更に関係なくキャッシュされたままです。
適応的思考のトリガー動作はプロンプト可能です。Claude がより頻繁に、またはより少なく思考している場合は、システムプロンプトにガイダンスを追加できます:
Extended thinking adds latency and should only be used when it
will meaningfully improve answer quality — typically for problems
that require multi-step reasoning. When in doubt, respond directly.Claude に思考を少なく行うよう指導することは、推論から利益を得るタスクの品質を低下させる可能性があります。本番環境にプロンプトベースのチューニングをデプロイする前に、特定のワークロードへの影響を測定してください。最初に低い努力レベルでテストすることを検討してください。
max_tokens を総出力(思考 + レスポンステキスト)のハード制限として使用します。effort パラメータは、Claude が割り当てる思考量に対する追加のソフトガイダンスを提供します。これらを組み合わせることで、コストを効果的に制御できます。
high と max 努力レベルでは、Claude はより広範に思考する可能性があり、max_tokens 予算を使い果たす可能性が高くなります。レスポンスで stop_reason: "max_tokens" が表示される場合は、モデルにより多くのスペースを与えるために max_tokens を増やすか、努力レベルを下げることを検討してください。
以下の概念は、適応モードと手動モードのどちらを使用するかに関係なく、拡張思考をサポートするすべてのモデルに適用されます。
With extended thinking enabled, the Messages API for Claude 4 models returns a summary of Claude's full thinking process. Summarized thinking provides the full intelligence benefits of extended thinking, while preventing misuse. This is the default behavior on Claude 4 models when the display field on the thinking configuration is unset or set to "summarized". On Claude Opus 4.7 and Claude Mythos Preview, display defaults to "omitted" instead, so you must set display: "summarized" explicitly to receive summarized thinking.
Here are some important considerations for summarized thinking:
In rare cases where you need access to full thinking output for Claude 4 models, contact our sales team.
The display field on the thinking configuration controls how thinking content is returned in API responses. It accepts two values:
"summarized": Thinking blocks contain summarized thinking text. See Summarized thinking for details. This is the default on Claude Opus 4.6, Claude Sonnet 4.6, and earlier Claude 4 models."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). This is the default on Claude Opus 4.7 and Claude Mythos Preview.Setting display: "omitted" is useful 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.
Here are some important considerations for omitted thinking:
signature to reconstruct the original thinking for prompt construction (see Preserving thinking blocks). Any text you place in the thinking field of a round-tripped omitted block is ignored.display is invalid with thinking.type: "disabled" (there is nothing to display).thinking.type: "adaptive" and the model skips thinking for a simple request, no thinking block is produced regardless of display.The signature field is identical whether display is "summarized" or "omitted". Switching display values between turns in a conversation is supported.
Claude Opus 4.7 では、thinking.display はデフォルトで "omitted" です。思考ブロックは依然としてレスポンスストリームに表示されますが、明示的にオプトインしない限り、それらの thinking フィールドは空です。これは Claude Opus 4.6 のデフォルトが "summarized" だった場合からのサイレント変更です。Claude Opus 4.7 で要約された思考テキストを復元するには、thinking.display を明示的に "summarized" に設定します:
thinking = {
"type": "adaptive",
"display": "summarized",
}display: "omitted" を使用したコード例とストリーミング動作については、拡張思考ページの思考表示の制御を参照してください。そこの例は type: "enabled" を使用しています。適応的思考では、以下を使用します:
thinking = {"type": "adaptive", "display": "omitted"}Full thinking content is encrypted and returned in the signature field. This field is used to verify that thinking blocks were generated by Claude when passed back to the API.
It is only strictly necessary to send back thinking blocks when using tools with extended thinking. Otherwise you can omit thinking blocks from previous turns. If you pass them back, whether the API keeps or strips them depends on the model: Opus 4.5+ and Sonnet 4.6+ keep them in context by default; earlier Opus/Sonnet models and all Haiku models strip them. See context editing to configure this.
If sending back thinking blocks, we recommend passing everything back as you received it for consistency and to avoid potential issues.
Here are some important considerations on thinking encryption:
signature_delta inside a content_block_delta event just before the content_block_stop event.signature values are significantly longer in Claude 4 models than in previous models.signature field is an opaque field and should not be interpreted or parsed.signature values are compatible across platforms (Claude APIs, Amazon Bedrock, and Vertex AI). Values generated on one platform will be compatible with another.For complete pricing information including base rates, cache writes, cache hits, and output tokens, see the pricing page.
The thinking process incurs charges for:
When extended thinking is enabled, a specialized system prompt is automatically included to support this feature.
When using summarized thinking:
When using display: "omitted":
thinking field is empty)The billed output token count will not match the visible token count in the response. You are billed for the full thinking process, not the thinking content visible in the response.
拡張思考ページは、モード固有のコード例を含む複数のトピックについてより詳しく説明しています:
tool_choice 制限に注意してください。adaptive と enabled/disabled モード間で切り替えると、メッセージのキャッシュブレークポイントが破損します(システムプロンプトとツール定義は引き続きキャッシュされます)。max_tokens とコンテキストウィンドウ制限とどのように相互作用するか。Was this page helpful?
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={"type": "adaptive"},
messages=[
{
"role": "user",
"content": "Explain why the sum of two even numbers is always even.",
}
],
)
for block in response.content:
if block.type == "thinking":
print(f"\nThinking: {block.thinking}")
elif block.type == "text":
print(f"\nResponse: {block.text}")client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "medium"},
messages=[{"role": "user", "content": "What is the capital of France?"}],
)
print(response.content[0].text)client = anthropic.Anthropic()
with client.messages.stream(
model="claude-opus-4-7",
max_tokens=16000,
thinking={"type": "adaptive"},
messages=[
{
"role": "user",
"content": "What is the greatest common divisor of 1071 and 462?",
}
],
) as stream:
for event in stream:
if event.type == "content_block_start":
print(f"\nStarting {event.content_block.type} block...")
elif event.type == "content_block_delta":
if event.delta.type == "thinking_delta":
print(event.delta.thinking, end="", flush=True)
elif event.delta.type == "text_delta":
print(event.delta.text, end="", flush=True)手動モード、ツール使用、プロンプトキャッシングを含む拡張思考について詳しく学びます。