response_format asks for the answer in a shape your code can parse instead of prose.
The three forms
json_object promises valid JSON and nothing about its shape. json_schema promises the
shape as well, which is almost always what you actually wanted.
With
json_object, say in the prompt what fields you expect. The constraint is only
“this parses”; a model given no other instruction will happily return valid JSON with
different keys every time.Rejected rather than ignored
If no provider that can serve your model supports the format you asked for, the call returnsMODEL_CAPABILITY_UNSUPPORTED — it is not answered as free text.
The reasoning is the same as for tool calling: a response that quietly
ignored your schema would parse as prose, pass a shallow test, and fail somewhere far from
here. Prefer the error.
Tools or schema?
Both get structure out of a model, and they answer different questions:
Asking for a schema is cheaper and simpler when you do not need the model to choose.
Next
Tool calling
When the model should act rather than answer.
Errors
MODEL_CAPABILITY_UNSUPPORTED in context.