Structured output format configuration for AI models that support schema-constrained responses.
The schema is sent to the model's provider, which constrains decoding to it - the model cannot
generate tokens that violate the schema, so the response conforms to it exactly.
A schema the provider rejects is reported as a 400 carrying its diagnostic, and a model whose
protocol cannot carry a schema at all refuses the request with STRUCTURED_OUTPUT_NOT_SUPPORTED
rather than answering without the shape that was asked for.
Example:
Structured output format configuration for AI models that support schema-constrained responses.
The schema is sent to the model's provider, which constrains decoding to it - the model cannot generate tokens that violate the schema, so the response conforms to it exactly.
A schema the provider rejects is reported as a
400carrying its diagnostic, and a model whose protocol cannot carry a schema at all refuses the request withSTRUCTURED_OUTPUT_NOT_SUPPORTEDrather than answering without the shape that was asked for. Example:See