Reasoning Models
ShuYou provides fine-grained control over model reasoning behavior and supports multiple API protocols:- OpenAI Chat Completion API: use the
reasoning_effortorreasoningparameter - OpenAI Responses API: use the
reasoningparameter to control reasoning intensity and summaries - Anthropic Messages API: use the
thinkingparameter to enable Extended Thinking - Google Vertex AI API: use the
thinking_configparameter to control Thinking Mode
OpenAI Chat Completion API
Parameter Reference
reasoning_effort
A reasoning-intensity parameter that follows the OpenAI protocol, used to control the depth of the model’s reasoning. Available values:low: low-intensity reasoning, suitable for simple tasksmedium: medium-intensity reasoning (default)high: high-intensity reasoning, suitable for complex tasksminimal: minimal reasoning intensity
reasoning
Thereasoning parameter provides more fine-grained reasoning control and supports the following fields:
effort
Equivalent to thereasoning_effort parameter, intended for models that only support reasoning_effort. Available values are the same as reasoning_effort.
max_tokens
Limits the maximum number of reasoning tokens, intended for models that support a thinking budget. This lets you precisely control how many tokens the model can spend during the reasoning phase.enabled
Controls whether reasoning is enabled. The default istrue; set to false to disable reasoning.
Parameter Priority and Auto-Calculation
ShuYou automatically computes and fills in the parameters required by the model based on what you provide, ensuring optimal reasoning behavior.Default parameter completion
When neitherreasoning_effort nor reasoning is provided, the system automatically applies the following default configuration:
Automatic max_tokens calculation
When the user specifiesmax_completion_tokens, or when the model itself has a max_completion_tokens limit, the system automatically calculates reasoning.max_tokens based on reasoning.effort.
Rules:
Reverse inference of effort
When the user providesmax_tokens but does not specify effort, the system infers effort using the following rules:
- Compute the ratio:
reasoning.max_tokens / max_completion_tokens - Compare the ratio against the standard tiers (20%, 50%, 80%)
- Choose the closest tier as the
effortvalue
reasoning.max_tokens / max_completion_tokens = 30%, the system will automatically set effort to low.
API Call Examples
Native call with the OpenAI Python SDK
Use the native OpenAI Python SDK call pattern and pass thereasoning_effort parameter directly:
Advanced usage with the OpenAI Python SDK
Achieve finer-grained reasoning control via theextra_body parameter:
cURL
Using the reasoning parameterUsing the reasoning_effort parameter
Extracting reasoning output
Retrieve the model’s reasoning process to understand how it arrived at the final answer:OpenAI Responses API
The OpenAI Responses API uses thereasoning parameter to control reasoning behavior. It is similar to the Chat Completion API, but the parameter placement differs slightly.
Parameter Reference
reasoningeffort: controls reasoning intensity; supportsnone/minimal/low/medium/high/xhighsummary: reasoning summary level; supportsauto/concise/detailed
API Call Examples
Python
TypeScript
cURL
Response Format
The Responses API returnsreasoning content blocks in the output array:
Anthropic Messages API (Extended Thinking)
Anthropic Claude models provide reasoning capabilities via Extended Thinking. Enable it with thethinking parameter; the model will perform deep reasoning before answering.
Supported Models
- Claude Sonnet 4.5
- Claude Sonnet 4
- Claude Haiku 4.5
- Claude Opus 4.5 / 4.1 / 4
Parameter Reference
thinkingtype: set to"enabled"to enable Extended Thinkingbudget_tokens: the thinking token budget, which controls the maximum number of tokens the model can use for reasoning
API Call Examples
Python
TypeScript
cURL
Response Format
When Extended Thinking is enabled, the response includes two content-block types:thinking and text:
Streaming Responses
When streaming, thinking content is returned via thethinking_delta event:
Google Vertex AI API (Thinking Mode)
Google Vertex AI Gemini models provide reasoning capabilities via Thinking Mode, controlled with thethinking_config parameter.
Supported Models
- Gemini 3 Pro / Pro Image
- Gemini 2.5 Pro / Flash / Flash-Lite
Parameter Reference
Gemini 3 and later usethinking_level, while Gemini 2.5 uses thinking_budget:
Gemini 3+ (thinking_level)
API Call Examples
Python - Gemini 3
Python - Gemini 2.5
TypeScript