Detecting Model Refusals
A model can decline to generate content and still return HTTP 200. Inspect the output, stop reason or terminal stream event.
On this page
| Endpoint | What to inspect |
|---|---|
| Chat Completions | Inspect choices[].finish_reason, message content and any refusal fields. content_filter is one possible finish reason. |
| Responses | Inspect output messages for refusal blocks and check status and incomplete_details. |
| Messages | Inspect stop_reason, which may be refusal, and any notice in content. For a stream, read the stop reason from message_delta. |
Show any refusal message and ask the user to revise their input in line with the content rules. For empty text, check the stop reason, tool calls and disconnects.