GPT reasoning settings
This page covers reasoning effort, reasoning summaries and answer length control for the GPT family. For model IDs and endpoint setup, see the GPT family overview.
GPT-5 and later models support reasoning: they reason internally before answering, which helps with math, code and multi-step analysis.
- Common values are
low,mediumandhigh. Higher effort means more reasoning tokens and longer latency. Passing a value the model doesn’t support returns 400, and the error message lists the values that model supports. - When
reasoning_effortis omitted, the default differs by model: for example, GPT-5.4 and GPT-6 Sol do not reason by default, while GPT-5 does. Pass it explicitly when you need reasoning. - Reasoning tokens are billed at the output rate and count toward
max_completion_tokens(max_output_tokensin Responses).
Reasoning summaries
The Responses API can return a summary of the reasoning process; Chat Completions does not return reasoning content:
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"])
resp = client.responses.create(
model="openai/gpt-5.4",
reasoning={"effort": "medium", "summary": "auto"},
max_output_tokens=20000,
input="Find all positive integers n less than 50 for which n² + n + 41 is not prime, and briefly explain why.",
)
for item in resp.output:
if item.type == "reasoning":
for s in item.summary:
print("[Reasoning summary]", s.text)
print("[Answer]", resp.output_text)output may contain several reasoning items, and some have an empty summary array, so check each one as you read them. When there is little reasoning, there may be no summary.
Controlling answer length
GPT-5 series models support verbosity in Chat Completions, with values low, medium and high, to control how detailed the answer is. Unlike max_completion_tokens, it does not truncate the answer.
For other errors, see Common errors.