#Set no thinking in sdk with gpt5

1 messages · Page 1 of 1 (latest)

lofty spoke
#

I use gpt5 and gpt5-mini in my project.
Gpt5 works well in a lot of parts in my work.
However, I can not set model to stop think.
It seems model auto deside think or not , which waste of a lot of time and money.

Is it possible to control the "thinking" by my hand?

I am seeking a params or a format of prompt

little coyoteBOT
#

Hi @lofty spoke. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes, you can control the amount of "thinking" (reasoning) GPT-5 and GPT-5-mini perform by setting the reasoning effort parameter in your API call. This allows you to minimize or eliminate the model's internal chain-of-thought reasoning, which reduces latency and cost.

How to set minimal or no "thinking":

  • Use the reasoning parameter with "effort": "minimal" or "effort": "low" in your API request.
  • This works for both the Responses API and the Chat Completions API.

Example (Python, Responses API):

from openai import OpenAI
client = OpenAI()

result = client.responses.create(
    model="gpt-5",
    input="Write a haiku about code.",
    reasoning={ "effort": "minimal" },  # or "low"
    text={ "verbosity": "low" }
)

print(result.output_text)

Or with curl:

curl <https://api.openai.com/v1/responses> \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-5",
    "input": "Write a haiku about code.",
    "reasoning": { "effort": "minimal" }
  }'
  • For Chat Completions, use the reasoning_effort parameter:
    "reasoning_effort": "minimal"

Supported values:

  • "minimal": Few or no reasoning tokens, fastest, lowest cost
  • "low": Slightly more reasoning
  • "medium" (default): Balanced
  • "high": Deepest reasoning, slowest, most expensive

Note:

  • The "minimal" setting is ideal for simple, deterministic tasks where you don't need the model to "think" deeply or explain its answer.
  • This parameter is supported on gpt-5, gpt-5-mini, and gpt-5-nano models on both the Responses and Chat Completions APIs. If you get an error, ensure your SDK is up to date and you're using the correct endpoint and parameter name for your API version.