JSON schema mode
Returns JSON that conforms to a specific schema you define. Best for production pipelines where downstream consumers expect a fixed structure.- Python
- JavaScript
- cURL
Response
The
json_schema mode guarantees the output matches your schema. If the model cannot produce valid JSON matching the schema, it will retry internally. Use this for production pipelines where downstream consumers expect a fixed structure.JSON object mode
For arbitrary JSON without a specific schema. The model will return valid JSON, but the shape is not guaranteed.- Python
- JavaScript
- cURL