Reasoning effort and reasoning items

OpenAI API · Advanced · 12 min

Effort is a direct dial between quality, speed and cost, and mishandling reasoning items breaks tool loops.

Current OpenAI models are reasoning models: before answering they think privately, producing reasoning tokens you don't see. You control how much with the reasoning parameter.

reasoning={"effort": ...} accepts levels from none and minimal through low, medium and high up to xhigh and max. Not every model supports every level (some reject none), and defaults differ by model. Lower effort is faster and cheaper; higher effort helps with hard planning, maths and code.

You cannot read the raw reasoning, but reasoning={"summary": "auto"} adds a readable summary to the reasoning item in response.output. That is useful for debugging and for showing users progress.

Reasoning tokens matter for cost and limits:

  • They are billed as output tokens; see usage.output_tokens_details.reasoning_tokens.
  • max_output_tokens caps reasoning plus visible answer. Set it too low and the response ends incomplete, possibly before any text appears. Start generous, then tune from real usage.
  • They take space in the context window.

In tool loops, keep the reasoning items: when the model calls a function, pass back its reasoning items together with your function outputs. Appending all of response.output to your input, or chaining with previous_response_id, does this for you. Dropping them makes later steps worse.

A good habit: test each task at two or three effort levels on your eval set and keep the lowest that passes.

Example

from openai import OpenAI

client = OpenAI()
r = client.responses.create(
    model="gpt-6-astra",
    reasoning={"effort": "low", "summary": "auto"},
    input="A bat and ball cost $1.10; the bat costs $1 more. Price of the ball?",
    max_output_tokens=8000,          # covers reasoning + answer
)

for item in r.output:
    if item.type == "reasoning":
        for s in item.summary:
            print("[summary]", s.text)
print(r.output_text)
print("reasoning tokens:", r.usage.output_tokens_details.reasoning_tokens)

Remember

  • reasoning.effort trades quality for speed and cost
  • Reasoning tokens are hidden but billed as output and count toward max_output_tokens
  • Pass reasoning items back in tool loops

Watch out for

  • A tight max_output_tokens that the hidden reasoning uses up, leaving an empty answer.

Check yourself

  1. A response is incomplete with no visible text. What is the likely cause?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: developers.openai.com/api/docs/guides/reasoning