Reasoning Model
Reasoning models use internal reasoning tokens before producing a response.
Definition · At a glance · How it works
Definition
Reasoning models use internal reasoning tokens before producing a response. In addition to input and output tokens, reasoning models introduce reasoning tokens. The models use these reasoning tokens to think, breaking down the prompt and considering multiple approaches to generating a response.
OpenAI states that internal reasoning tokens help the model plan, use tools effectively, inspect alternatives, recover from ambiguity, and solve harder multi-step tasks. Reasoning tokens are not visible via the API.
At a glance
In the Responses API, function calling with a reasoning model involves reasoning items and tool outputs.
How it works
Reasoning models like gpt-5.5 and gpt-5.4 support interleaved thinking, where the model can generate visible output tokens before and in between thinking and can think in between tool calls. The reasoning.effort parameter guides the model on how much to think when performing a task. Supported values are model-dependent and can include none, minimal, low, medium, high, xhigh, and max.
OpenAI describes lower effort as favoring speed and lower token usage, and higher effort as making the model think more completely to provide higher quality responses. The models also reason adaptively across reasoning efforts, using fewer tokens for simpler tasks and thinking harder for complex tasks. GPT-5.6 and GPT-6 models support standard and pro reasoning modes in the Responses API.
Set reasoning.mode to pro for difficult tasks that need more model work and can tolerate higher latency and token usage. Reasoning mode and reasoning effort are independent. Mode selects standard or pro execution, while reasoning.effort controls how much reasoning the model applies within that mode.
Pro mode does more model work than standard mode, which increases token usage and cost. Pro mode aggregates the model work performed to produce the final answer and bills those tokens at the selected model's standard token rates. For models released before GPT-5.6, the default behavior in a multi-step conversation is to carry over input and output tokens from each step without rendering reasoning from earlier turns into the next sample.
GPT-5.6 models instead default to rendering available reasoning from earlier turns. Use reasoning.context to select either behavior on supported models. Conversation state and reasoning state serve different purposes.
Passing messages across calls gives the model the visible conversation history. Persisted reasoning provides continuity, but it does not expose the model’s raw reasoning. The reasoning items remain opaque, and the API does not return their reasoning text.
The response’s reasoning.context field contains the effective mode, either current_turn or all_turns. Persisted reasoning can be reused only within the same model family.
Example
In standard, single-agent mode on supported GPT-6 or later models, configuration_update can raise reasoning effort for difficult work or lower it for routine follow-ups. Place the update between responses and keep request-level reasoning.effort unchanged to preserve the original prompt prefix for prompt caching. In the documented example, if the conversation starts with request-level effort low, the update selects high for the next response and subsequent responses until another update overrides it. The documentation says the raw reasoning tokens emitted by the model are not exposed, but a summary of the model’s reasoning can be viewed using the summary parameter.
Reasoning summary output is part of the summary array in the reasoning output item. This output is not included unless you explicitly opt in to including reasoning summaries. The exact number of reasoning tokens used is visible in the usage object of the response object, under output_tokens_details.
Depending on the problem’s complexity, the models may generate from a few hundred to tens of thousands of reasoning tokens. If the generated tokens reach the context window limit or the max_output_tokens value you’ve set, you’ll receive a response with a status of incomplete and incomplete_details with reason set to max_output_tokens. A response can be incomplete before visible output tokens are produced, so input and reasoning tokens could incur costs without a visible response.
OpenAI recommends reserving at least 25,000 tokens for reasoning and outputs when you start experimenting with reasoning models. In the input array of an HTTP Responses or WebSocket response.create request, place the update before the next user message. Preserve updates with previous_response_id, or replay them in their original positions when managing history manually. The response's reasoning.effort still reports the request-level setting rather than the effort selected by the update.
Configuration updates cannot be combined with automatic compaction or automatic truncation. The standalone /responses/compact endpoint also rejects histories containing these updates.
{
"type": "configuration_update",
"reasoning": {
"effort": "high"
}
}from openai import OpenAI
client = OpenAI()
model = "gpt-6-astra"
response = client.responses.create(
model=model,
reasoning={"effort": "low"},
input="Draft a database migration plan.",
store=True,
)
print(response.output_text)
response = client.responses.create(
model=model,
previous_response_id=response.id,
reasoning={"effort": "low"},
input=[
{
"type": "configuration_update",
"reasoning": {"effort": "high"},
},
{
"role": "user",
"content": "Analyze the failure modes and propose rollback steps.",
},
],
store=True,
)
print(response.output_text)Sources
This page is written from the official sources below. Open them to check the original text.
- Official documentationhttps://developers.openai.com/api/docs/guides/reasoningFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.