OpenAI Reasoning
OpenAI reasoning models can think through problems before responding. You can control the depth of reasoning and receive summaries of the model's thought process. Each model supports different effort levels and defaults.
| Model | Effort levels | Default |
|---|---|---|
openai/gpt-5.4 | none, low, medium, high, xhigh | none |
openai/gpt-5.3-codex | low, medium, high, xhigh | low |
openai/gpt-5.2-codex | low, medium, high, xhigh | low |
openai/gpt-5.2 | none, low, medium, high, xhigh | none |
openai/gpt-5.1-codex | low, medium, high | low |
openai/gpt-5.1 | none, low, medium, high | none |
openai/gpt-5 | minimal, low, medium, high | medium |
openai/gpt-5-mini | minimal, low, medium, high | medium |
openai/gpt-5-nano | minimal, low, medium, high | medium |
| Model | Effort levels | Default |
|---|---|---|
openai/o3 | low, medium, high | medium |
openai/o3-mini | low, medium, high | medium |
openai/o4-mini | low, medium, high | medium |
For more details on each model, see the OpenAI model documentation.
Set reasoningSummary to receive the model's thought process as it streams. Different models support different summarizers. For example, o4-mini supports detailed summaries.
import { streamText } from 'ai';
const result = streamText({
model: 'openai/gpt-5',
prompt: 'Tell me about the Mission burrito debate in San Francisco.',
providerOptions: {
openai: {
reasoningEffort: 'high',
reasoningSummary: 'detailed', // 'auto' for condensed or 'detailed' for comprehensive
},
},
});
for await (const part of result.fullStream) {
if (part.type === 'reasoning-delta') {
process.stdout.write(part.text);
} else if (part.type === 'text-delta') {
process.stdout.write(part.text);
}
}For non-streaming calls, reasoning summaries are available in the reasoning field:
import { generateText } from 'ai';
const result = await generateText({
model: 'openai/gpt-5',
prompt: 'Tell me about the Mission burrito debate in San Francisco.',
providerOptions: {
openai: {
reasoningEffort: 'high',
reasoningSummary: 'auto',
},
},
});
console.log('Reasoning:', result.reasoningText);| Value | Description |
|---|---|
auto | Condensed reasoning summary |
detailed | Comprehensive reasoning summary |
concise | Brief reasoning summary |
Some models default to none for reasoning effort, meaning reasoning is
disabled unless you explicitly set an effort level. Check the supported models
table for each model's default.
For more details, see the OpenAI reasoning docs.
Was this helpful?