CORE
Structured outputs
Make a model return valid JSON — free-form or strictly matching your JSON schema — via the response_format parameter.
JSON mode
Pass { "type": "json_object" } to guarantee the reply is syntactically valid JSON.
JSON schema
For strict typing, pass a JSON schema — the model returns an object matching it exactly.
Model support
!
response_format is supported by Gemini and GPT models. Claude models have no native JSON mode — for strict JSON with Claude, use function calling (tools) with a single schema function instead.
Which models support what is summarized in Parameters.
NextImages →