Users Pricing

forum

Home Forums How does the OpenAI API represent a refusal in a strict JSON response? – MindStick

How does the OpenAI API represent a refusal in a strict JSON response?

Magdalena Michalska 139 16 Oct 2026

I’m using strict JSON Schema output in an OpenAI API request and wondering what happens when the model needs to refuse. Does the response still contain a schema-shaped object, or is the refusal surfaced outside the requested structure?

I’m especially interested in how people handle this in clients that expect to parse every successful response as JSON. Is there a reliable way to distinguish a refusal from a schema or parsing failure?


0 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md