Today I learned
Why is OpenAI output_text empty with max_output_tokens set?
With a reasoning model, max_output_tokens is one budget for the hidden reasoning and the visible answer. Set it to the size of the answer you want (say 300 for a short teaser) and the model can spend all of it thinking: you get status: "incomplete", incomplete_details.reason: "max_output_tokens", and no message item at all, so output_text is an empty string with no error.
Lower the reasoning effort and give the limit room for both:
const res = await openai.responses.create({
model: 'gpt-5.5',
instructions,
input,
reasoning: { effort: 'low' },
// reasoning tokens count here too; the answer itself is ~200
max_output_tokens: 4000,
})
if (res.status === 'incomplete' || !res.output_text.trim())
throw new Error(`No answer: ${res.incomplete_details?.reason ?? 'empty'}`)
Control the length of the answer in the prompt ("2–4 sentences"), not with the token limit, and treat an empty output_text as a failure so a fallback kicks in.
Hit this while building the Telegram channel announcements for this site: a model writes a short teaser for each new post, and the description is the fallback when it returns nothing.