Skip to main content

Responses API Empty output_text: When Reasoning Eats the Token Budget

Updated for the OpenAI Responses API with GPT-5.6 and GPT-6 reasoning models. Tested on the OpenAI Python SDK 1.x and later with Python 3.11 and 3.12.

The request returns HTTP 200, the SDK does not raise, and response.output_text is an empty string. Usage still reports output tokens, so the call was billed. Nothing failed in the network sense, which is why this is so often reported as "the API returns nothing" or "streaming stops early". The response is not broken: it is marked incomplete, and the reason is that the visible answer never got any of the token budget because reasoning consumed all of it.

This tutorial shows how to confirm that diagnosis from the response object and three ways to fix it, from raising the cap to spending fewer reasoning tokens per call.

What it looks like

A truncated but successful response, printed field by field:

print(response.status)
# incomplete

print(response.incomplete_details.reason)
# max_output_tokens

print(repr(response.output_text))
# ''

print(response.usage.output_tokens)
# 300
print(response.usage.output_tokens_details.reasoning_tokens)
# 300

Every output token in that example was reasoning. The output array may contain a reasoning item with no message, or nothing that renders as text at all. If you log only output_text, the failure looks like a silent empty result; the fields above are what turn it into a diagnosis.

Why it happens

Reasoning models produce internal reasoning tokens before the visible answer, and those tokens occupy the context window and are billed as output. max_output_tokens in the Responses API is a single ceiling over everything generated: reasoning tokens, visible output tokens, and non-visible formatting tokens. There is no separate knob for "thinking" and "answer".

The reasoning guide states the consequence directly: when generated tokens reach max_output_tokens, the response comes back with status incomplete and incomplete_details.reason set to max_output_tokens, and this can happen before any visible output token is produced, so you pay for input and reasoning without receiving text. Hard prompts make this worse rather than better: the model thinks longer precisely when the task is difficult, which is the moment you most want an answer.

Small caps make it reproducible. A value that looks generous for a two-sentence answer, such as 300, can be entirely consumed on a multi-step analysis. The parameter also has a floor of 16 in the request schema, so values below that are rejected outright rather than rounded up.

Fix 1: raise the cap with real headroom

The documented starting point is to leave room for reasoning and output together. OpenAI recommends reserving at least 25,000 tokens for both when you begin experimenting with reasoning models, then tightening it once you know what your prompts actually use:

from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-6.2-astra",
    reasoning={"effort": "medium"},
    input="Review this migration plan and list the failure modes.",
    max_output_tokens=25000,
)

if response.status == "incomplete":
    print("stop reason:", response.incomplete_details.reason)
    print("reasoning tokens:", response.usage.output_tokens_details.reasoning_tokens)

Raising the cap does not commit you to spending it; it removes a ceiling that was truncating the run. Measure the reasoning share over a few dozen real requests and set the cap at roughly the observed 95th percentile plus a margin, not at the smallest value that happened to work on one prompt.

Fix 2: detect the incomplete status and retry once

The failure is visible in the response, so handle it as a first-class outcome instead of hoping the next call behaves. A single retry with a larger budget recovers most cases, and it costs far less than sending the same request to a smaller model that cannot do the task:

def ask(prompt: str, budget: int = 8000) -> str:
    response = client.responses.create(
        model="gpt-6.2-astra",
        input=prompt,
        reasoning={"effort": "medium"},
        max_output_tokens=budget,
    )

    if (
        response.status == "incomplete"
        and response.incomplete_details.reason == "max_output_tokens"
        and not response.output_text
    ):
        response = client.responses.create(
            model="gpt-6.2-astra",
            input=prompt,
            reasoning={"effort": "medium"},
            max_output_tokens=budget * 3,
        )

    return response.output_text

Guard the retry. If the second response is still incomplete with an empty body, return a typed failure to the caller rather than looping; at that point the prompt is asking for more work than the budget allows, and no amount of retrying fixes that. Note the condition: a partial answer with a truncation is often still useful, so check output_text before discarding the first response. Only retry when there is nothing to show the user.

Fix 3: spend fewer reasoning tokens

When the budget is fixed by cost or latency, reduce what the model spends thinking instead of raising the ceiling. reasoning.effort is the supported control, and the values are model dependent: none, minimal, low, medium, high, xhigh and max, with the supported subset listed on each model page:

response = client.responses.create(
    model="gpt-6-luna",
    reasoning={"effort": "low"},
    input=prompt,
    max_output_tokens=4000,
)

For classification, extraction and routing calls, low effort with a small cap is usually both cheaper and more predictable than medium effort with a large one. Two related levers matter as much. Trimming the input reduces the chance that reasoning is spent re-reading irrelevant context, and splitting a broad request into two narrow calls tends to use less reasoning in total than one sprawling request, because each call stops thinking when its own subproblem is resolved.

Check the model's supported effort values before shipping. Some models reject none with an HTTP 400, so a copy-pasted configuration from another model can fail for a reason that has nothing to do with token budgets.

Preventing it

Log four fields for every reasoning call: status, incomplete_details.reason, usage.output_tokens and usage.output_tokens_details.reasoning_tokens. Alert when the reasoning share of output tokens crosses a threshold you set per prompt type, because a prompt whose reasoning usage triples after an unrelated input change is drifting toward silent truncation. Treat incomplete as a handled outcome in the client contract rather than an unexpected state, and keep the empty response path tested with a deliberately tiny cap so the fallback is exercised in CI and not in production.

We use cookies for ads and analytics.