response_format parameter to make a model return JSON, either
free-form JSON (json_object) or JSON that conforms to a schema you provide
(json_schema). This works on the standard /v1/chat/completions endpoint.
Support for strict
json_schema mode varies by model. JSON mode
(json_object) is broadly supported. Discover models with
GET /v1/models and test your schema against the model you
intend to use.JSON mode
Ask for any valid JSON object with{"type": "json_object"}:
JSON schema mode
For a guaranteed structure, pass{"type": "json_schema", "json_schema": {...}}
with a JSON Schema. The model’s output is constrained to match it.
content is a JSON string matching the schema: