
1. Thinking du modèle (Extended Thinking)
1.1 Avantages du thinking entrelacé
When interleaved thinking is not enabled, the model performs thinking only once at the beginning of an assistant turn; subsequent responses are generated directly after receiving tool results, without producing new thinking blocks:- Perform secondary reasoning based on tool results, rather than simply concatenating outputs.
- Chain reasoning between multiple tool calls, where each decision is based on the analysis of the previous step.
Reference: Anthropic Interleaved Thinking
1.2 Enabling Thinking
You can enable thinking in four ways, choosing any one of them:Priority (when multiple methods are used):Possible values for effort:reasoning_effort>reasoning.max_tokens>reasoning.effort>-thinksuffix
minimal / low / medium / high / xhigh
1.3 Thinking Return
The response message will include two new fields:reasoning_content: Thinking content (string), for easy display.reasoning_details: Complete structured information about thinking, which needs to be returned as-is in multi-turn conversations; the internal structure may differ between providers.
delta.reasoning_content and delta.reasoning_details. For the complete streaming concatenation logic, refer to the full example below.
1.4 Retaining Thinking in Multi-Turn Conversations (Interleaved Thinking is built-in, no additional parameters needed)
To enable the model to continue its reasoning capabilities in multi-turn conversations, simply place the previously returnedreasoning_details as-is into the next round’s assistant message:
1.5 Complete Example
The following two examples demonstrate the complete multi-turn Tool Call + interleaved thinking process: user inquiry → model thinks and calls a tool → inject tool results (preservingreasoning_details) → model interleaved thinking gives the final response.
Non-streaming · Interleaved Thinking
1.6 Thinking Intensity Mapping Rules
Effort Mode:- Opus 4.6 / Sonnet 4.6 and above: maps to Anthropic’s native Adaptive Thinking effort level.
- Other models: calculated using the formula for
budget_tokens:
Adaptive Thinking Effort Mapping:
max_tokens Mode: Directly assigned as Anthropic’s
budget_tokens.
-think suffix: Opus/Sonnet 4.6+ uses adaptive thinking (effort=medium); other models set budget_tokens = min(10240, max_tokens - 1), with a default max_tokens of 4096.
2. Prompt Caching
You can use Prompt Caching when making requests to the Claude model via the Chat interface. By settingcache_control breakpoints in messages, large blocks of text (like role cards, RAG data, book chapters, etc.) can be cached for reuse, allowing subsequent requests to hit the cache directly and significantly reduce costs.
Claude Official Documentation: Prompt Caching
2.1 Caching Costs
2.2 Supported Models and Minimum Cache Length
Breakpoint Quantity Limit: A maximum of 4 cache_control breakpoints per request.
2.3 Cache TTL
Writing costs for 1-hour TTL are higher, but they can save total expenses by reducing repeated writes in lengthy sessions. All models from Claude 4.5 and later from all providers (including Anthropic, Amazon Bedrock, Google Vertex AI) support 1-hour TTL.
2.4 Usage
You can set cache breakpoints using thecache_control field in system, user (including images), and tools. The following examples only show the key structure, omitting large blocks of text.
System Message Caching (default 5-minute TTL):
cache_control is placed at the top level of the tool object (alongside type and function):
2.5 Viewing Cache Status
The response’susage will return claude_cache_tokens_details, recording detailed cache information:
First Request (Creating Cache):
3. Request Header for anthropic-beta
You can enable beta features of the Claude model via the HTTP Headeranthropic-beta, which AihubMix will pass through to the Anthropic API.
Usage
Addanthropic-beta to the request header, with the value being the corresponding beta feature identifier:
For specific available beta identifiers, please refer to the Anthropic API Documentation.
Dernière mise à jour : 2026-06-01