Short answer
This is not an API failure — it is the thinking budget eating the output budget. Reasoning models such asgpt-6.1-sol first generate a reasoning trace, then write the answer. Both parts share the max_tokens allowance. When the budget runs out during thinking, the answer is cut off before it starts, so you receive an empty result.
Raise max_tokens (size it to the task, not to the visible answer), or lower the reasoning effort, and the problem disappears.
What you will see
There are two common forms. One is an explicit error, with HTTP status 429 or 500 (themessage field may be localized, so a Chinese message is expected on some responses):
completion_tokens is 300, reasoning_tokens is 300, text_tokens is 0 — the model generated 300 tokens, spent all of them thinking, and never wrote a single word of output.
A third form appears on /v1/responses: status: "incomplete" with an empty output_text:
gpt-5.5 at high / xhigh effort can spend 35,000–65,000+ tokens on internal deliberation alone. Even max_output_tokens=65000 can be completely exhausted before the visible answer begins — and if your streaming loop only listens for response.output_text.delta and response.completed while ignoring response.incomplete, the terminal prints nothing at all after waiting 10–20 minutes.
The call log shows the request as successful and billed, which is not a contradiction: the model did produce content (the reasoning trace), just no visible text.
Why this happens
A reasoning model’s output has two stages:max_tokens (or max_completion_tokens, max_output_tokens) limits both stages combined, not the length of the visible answer.
So if max_tokens is set to something small like 200–500 while the task needs substantial reasoning, the budget is exhausted during thinking. finish_reason becomes length and the content is empty.
Three checks
1
Step 1: read finish_reason
If it is
length, the output was truncated — the model did not refuse to answer. If it is stop but the content is still empty, continue to steps 2 and 3.2
Step 2: read reasoning_tokens in usage
Find
usage.completion_tokens_details.reasoning_tokens (Claude native responses put it in usage.output_tokens_details.thinking_tokens) and compare it with completion_tokens. If the two are close or equal, most of the budget went into thinking.3
Step 3: read max_tokens in your request
If you explicitly set
max_tokens to a small value (300, for example), that is almost certainly the cause. If you did not set it, check whether your SDK or framework filled in a small default.How to fix it
Raise max_tokens
The direct fix. Start at 2,000 for ordinary chat and 16,000+ for heavy reasoning; for
gpt-5.5 high-effort math/algorithm proofs set max_output_tokens to 100,000–128,000; on Claude 5.x start at 64,000 (128,000 cap).Lower reasoning effort
OpenAI uses
reasoning_effort (or reasoning.effort on Responses — prefer high before jumping to xhigh); Claude uses output_config.effort (top level, not inside thinking); Gemini uses thinkingConfig.Switch to streaming
Set
stream to true. On OpenAI /v1/responses, also pass reasoning={"effort": "high", "summary": "auto"} and handle response.incomplete so you see live reasoning progress and explicit truncation alerts.Parameter reference by model family
If you are on Claude
Claude uses different field names and parameters:- The cutoff flag is
stop_reasonwith valuemax_tokens, notfinish_reason. - Thinking tokens are in
usage.output_tokens_details.thinking_tokens, notreasoning_tokens. - The effort parameter is
output_config.effort, notreasoning_effort.
thinking: {"type": "between_tools"}; Haiku 5.5 and Opus 5 accept disabled when effort is high or lower.
For coding and long-form work on Claude 5.x, start max_tokens at 64,000; the model cap is 128,000. 30,000 is easily consumed by thinking. See Claude Effort and Thinking Guide.
FAQ
Why does the log show success while I received an error?
Why does the log show success while I received an error?
The log records that the upstream finished generating and settled billing. It does not check whether the visible text is empty. Generation succeeding and the answer being non-empty are two different things.
Will simply retrying help?
Will simply retrying help?
Usually not. With the same prompt and the same
max_tokens, the model will most likely spend the budget on thinking again. Changing the parameters is far more effective than retrying.Am I billed for an empty response?
Am I billed for an empty response?
Yes. Reasoning tokens are real consumption and are billed as output tokens. Check call logs for the exact amount.
Does every model behave this way?
Does every model behave this way?
No. Only reasoning models with a thinking stage have this problem. Ordinary non-reasoning models such as
gpt-4o or deepseek-chat spend the whole max_tokens on visible output.Does a large max_tokens cost more?
Does a large max_tokens cost more?
No.
max_tokens is a ceiling, not actual consumption. The model stops when it finishes, and you pay for the tokens actually generated.Related
What is max_tokens?
Parameter meaning, naming history, and per-model defaults
Streaming vs non-streaming
Prefer streaming for long responses and reasoning models
How to troubleshoot model errors
General triage for 400, 401, 429, and 503
How to read billing in logs
Confirm whether a request was billed, and how much