Home → Help
Empty response with finish_reason content_filter
A moderation layer stopped generation. The request ran, so it is a normal response rather than an error, and any tokens produced before the stop are billed.
What you are seeing
finish_reason: content_filter with empty or partial contentThe response object is well formed but content is an empty stringIt happens on some inputs and never on othersThe same prompt works on a different model
Why it happens
Filtering can apply to the prompt or to the output as it is produced. A stop partway through means the output tripped it; an immediate empty response usually means the input did.
Thresholds differ by model and by provider, so the same text can pass on one and stop on another. That is why switching models appears to 'fix' it.
It is easy to confuse with truncation. The difference is in finish_reason: length means you ran out of tokens, content_filter means the content was refused.
How to fix it
- Branch on finish_reasonHandle content_filter as its own case with a message to the user. Retrying identical input produces the identical result and only costs money.
- Check which side trippedSend the prompt with a minimal max_tokens. If it still stops immediately, the input is the trigger, not the output.
- Rephrase rather than retryIf the task is legitimate, removing the specific phrasing that triggers it usually works. Quoted user content is a frequent cause.
A filtered response is a completed request, so the tokens generated before the stop appear in your APICLAN usage log and are charged. An empty completion with a nonzero output count is exactly this case.
Related
Last checked 2026-10-01. Written from problems diagnosed on a live
OpenAI-compatible gateway, not collected from other sites.