Responses API: The reasoning Object in Detail
On this page
The reasoning Object in the Responses API
xAI’s Responses API offers fine-grained control over reasoning via the reasoning object. This parameter is available only on the Responses API (not on Chat Completions) and lets you configure three aspects of reasoning: effort, summary generation, and summary format.
Complete Structure of the reasoning Object
{
"model": "grok-4.20-0309-reasoning",
"input": "Your question here",
"reasoning": {
"effort": "medium",
"generate_summary": true,
"summary": "auto"
}
}
effort
Controls the model’s depth of thought. Three possible values:
low: minimal thought, suited for simple tasksmedium: balance between depth and speedhigh: maximum thought for complex problems
This parameter is the Responses API equivalent of reasoning_effort in Chat Completions, but with an additional medium value.
generate_summary
A boolean that indicates whether the model should produce a summary of its reasoning in addition to the final answer.
{
"model": "grok-4.20-0309-reasoning",
"input": "Compare the advantages of quicksort and mergesort.",
"reasoning": {
"effort": "high",
"generate_summary": true
}
}
When generate_summary is set to true, the response contains an additional element with a concise summary of the reasoning process. This summary is in plaintext (not encrypted), which distinguishes it from reasoning.encrypted_content.
summary
Controls the format of the generated summary. For now, the only documented value is "auto", which lets the model choose the most appropriate format.
{
"reasoning": {
"effort": "high",
"generate_summary": true,
"summary": "auto"
}
}
Difference Between Summary and Encrypted Reasoning
These two mechanisms are complementary but distinct:
| Aspect | Summary (generate_summary) | Encrypted (include) |
|---|---|---|
| Readability | Plaintext, understandable | Encrypted, opaque |
| Primary usage | User display, audit | Reuse in subsequent requests |
| Activation | reasoning.generate_summary: true | include: ["reasoning.encrypted_content"] |
| Detail | Condensed summary | Full reasoning |
| Availability | Responses API only | Responses API only |
You can enable both simultaneously to get both a readable summary and the full encrypted reasoning:
response = client.responses.create(
model="grok-4.20-0309-reasoning",
input="Demonstrate the infinitude of prime numbers.",
reasoning={
"effort": "high",
"generate_summary": True,
"summary": "auto"
},
include=["reasoning.encrypted_content"]
)
Common Combinations
Minimal Usage: Effort Only
{
"reasoning": {
"effort": "low"
}
}
The model reasons with minimal effort. No summary, no encrypted reasoning returned.
Intermediate Usage: Effort + Summary
{
"reasoning": {
"effort": "medium",
"generate_summary": true,
"summary": "auto"
}
}
The model reasons and provides a readable summary. Ideal for applications that want to show the thought process to the user.
Full Usage: Effort + Summary + Encrypted
{
"reasoning": {
"effort": "high",
"generate_summary": true,
"summary": "auto"
},
"include": ["reasoning.encrypted_content"]
}
Maximum configuration: deep reasoning, readable summary, and encrypted content for reuse. Reserve this for cases where you need everything.
When to Omit the reasoning Object
If you don’t need to control reasoning, you can simply omit the reasoning parameter. The model will use its default settings. This remains valid and the model will still reason (since grok-4.20-0309-reasoning is a reasoning model by nature).
Key Takeaways
- The
reasoningobject is available only on the Responses API effortcontrols depth (low,medium,high)generate_summaryproduces a readable summary of reasoning (plaintext)summary: "auto"lets the model choose the summary format- You can combine summary and encrypted reasoning in the same request
- Omitting
reasoningis valid: the model reasons with default settings