OpenAI response status: "incomplete" with incomplete_details.reason: "max_output_tokens"

The OpenAI Responses API can return a response whose status is "incomplete" and whose incomplete_details.reason is "max_output_tokens". It usually gets reported as "the API returned an empty response" or "output_text is empty", because with a reasoning model the hidden reasoning tokens can use the whole output budget before any visible text is written. It is a response state, not an exception, so nothing in your error handling fires.

The 30-second answer

The exact error

There is no error message string. The condition is two field values on an otherwise normal response object:

status: "incomplete"
incomplete_details.reason: "max_output_tokens"

Wording source: OpenAI's reasoning guide, section "Allocating space for reasoning", fetched 9 November 2026: "If the generated tokens reach the context window limit or the max_output_tokens value you’ve set, you’ll receive a response with a status of incomplete and incomplete_details with reason set to max_output_tokens." The two lines above are those field names and values, not a literal API body.

Verified against the docs and the SDK — 9 November 2026

Confirmed on official pages fetched today.

Reproduced today, client side only. Environment: openai==3.48.0, Python 3.11.9, macOS. A local HTTP server on 127.0.0.1 returned HTTP 200 with a Responses-shaped JSON body with status: "incomplete". The body shape follows OpenAI's documented response object; the values, including the token counts, were made up for the mock and were not observed from OpenAI's live API. Two cases: an output list with only a reasoning item, and one with a reasoning item plus a truncated message.

openai 3.48.0 / Python 3.11.9 / Darwin

--- mock case: reasoning_only (HTTP 200, status=incomplete) ---
exception raised:        no
requests seen by server:  1 [('/v1/responses', '0')]
resp.status:              'incomplete'
resp.incomplete_details:  IncompleteDetails(reason='max_output_tokens')
resp.error:               None
resp.output_text:         ''
output item types:        ['reasoning']
usage.output_tokens:      300 | reasoning_tokens: 300
bool(resp.output_text):   False

--- mock case: partial_text (HTTP 200, status=incomplete) ---
exception raised:        no
requests seen by server:  1 [('/v1/responses', '0')]
resp.status:              'incomplete'
resp.incomplete_details:  IncompleteDetails(reason='max_output_tokens')
resp.error:               None
resp.output_text:         '#!/bin/bash\n# transpose a matrix given as'
output item types:        ['reasoning', 'message']
usage.output_tokens:      300 | reasoning_tokens: 288
bool(resp.output_text):   True

What this shows: the SDK treats the response as a success. No exception, one request, no automatic retry, resp.error is None, and resp.output_text is an empty string when the output list holds no message item. The SDK source documents that: "If no output_text content blocks exist, then an empty string is returned."

Not verified: no request was sent to OpenAI's live API, so how many reasoning tokens a given model and prompt use, what the live output list contains when the cap is hit, streaming behaviour, and what appears on an invoice were not observed.

Cause 1: reasoning used the whole budget (empty output_text)

Symptom: output_text is empty and usage.output_tokens_details.reasoning_tokens is at or near usage.output_tokens. The cap covers reasoning and visible output together, and the guide says models "may generate anywhere from a few hundred to tens of thousands of reasoning tokens". A cap sized for the visible answer alone can be spent before the answer starts.

Fix: raise max_output_tokens, starting from the documented 25,000 and tuning down once you have seen real reasoning_tokens figures for your prompts. The guide also says lower reasoning.effort "favors speed and lower token usage"; the supported effort values are model-dependent, so check the model's page before changing it.

Cause 2: the cap is too low for the visible answer (partial text)

Symptom: output_text contains text that stops mid-sentence. The same status and reason apply; the model simply reached the cap while writing.

Fix: raise the cap or ask for a shorter answer. Do not parse a truncated answer as if it were complete, particularly JSON.

Cause 3: the context window filled up

The guide's sentence covers two limits: the max_output_tokens value you set, or "the context window limit". So the same reason can appear when you set no cap, if input plus generated tokens fill the model's window. The guide's fix is to "ensure there’s sufficient space in the context window". Shorten the input or the carried conversation. This is different from an input that is too long to accept at all, which is rejected with an error and is covered on the context-length page linked below.

Cause 4: your code never checks status

Whatever the cause, the response needs a status check, because nothing is raised. This is the Python handling example from OpenAI's reasoning guide, excerpted from the published sample with the import and prompt lines omitted (the model name is the one in their example; the last line in the docs is a print, where you would retry with a larger cap or surface the failure):

response = client.responses.create(
    model="gpt-6-astra",
    reasoning={"effort": "medium"},
    input=[{"role": "user", "content": prompt}],
    max_output_tokens=300,
)

if (
    response.status == "incomplete"
    and response.incomplete_details.reason == "max_output_tokens"
):
    print("Ran out of tokens")
    if response.output_text:
        print("Partial output:", response.output_text)
    else:
        print("Ran out of tokens during reasoning")

The other documented reason values (max_messages, content_filter, steered) are different conditions and raising the token cap is not their fix.

FAQ

Is status "incomplete" an error? Why did my try/except not catch it? It is not an exception. In a run on 9 November 2026 against a local mock server returning HTTP 200 with status "incomplete", openai 3.48.0 (Python) raised nothing, made exactly one request with no retry, and returned a normal response object with resp.error set to None. You have to check resp.status and resp.incomplete_details yourself.

Am I charged for an incomplete response with no visible output? OpenAI's reasoning guide says this can happen before any visible output tokens are produced, "meaning you could incur costs for input and reasoning tokens without receiving a visible response", and that reasoning tokens are billed as output tokens. We did not make a paid call to confirm a charge on an invoice.

What should I set max_output_tokens to for a reasoning model? OpenAI's reasoning guide recommends reserving at least 25,000 tokens for reasoning and outputs when you start experimenting, then adjusting once you know how many reasoning tokens your prompts use. The API reference describes max_output_tokens as an upper bound that includes visible output tokens and reasoning tokens, with a minimum of 16.

What is the Chat Completions equivalent? Chat Completions has no status or incomplete_details field. Its API reference says finish_reason is "length" if the maximum number of tokens specified in the request was reached, and that max_completion_tokens is an upper bound including visible output tokens and reasoning tokens.


Related

Verified on 9 November 2026: documentation wording checked against OpenAI's reasoning guide and API reference fetched that day; SDK behaviour reproduced with openai 3.48.0 on Python 3.11.9 against a local mock server (output shown above). No live OpenAI API call was made.