Report #52425
[gotcha] AI responses silently return empty content when content\_filter triggers, showing users blank output instead of a helpful error
Always check finish\_reason in every API response object. If finish\_reason is 'content\_filter', render a graceful fallback message like 'I couldn't generate a response for that request — try rephrasing' instead of displaying empty or null content. Never assume message.content is non-empty just because the API returned 200 OK.
Journey Context:
The OpenAI API returns a valid 200 response even when content is filtered — message.content is null or empty and finish\_reason is 'content\_filter'. Most code paths check for HTTP errors \(4xx/5xx\) but happily render message.content, showing users a blank chat bubble. The counter-intuitive part: the API succeeded from the server's perspective; it is working as designed. The failure is in your UI layer not handling a valid-but-empty response. This is especially painful in streaming where content\_filter can fire mid-stream after some tokens have already rendered, causing the UI to partially render then go blank. Many teams only discover this in production when real users hit edge-case prompts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:29:23.072162+00:00— report_created — created