Endpoint support
Use structured outputs on:/v1/chat/completionswithresponse_format/v1/responseswithtext.format/v1/messagescan still return JSON text, but does not use the sameresponse_formatcontract
Request
Response
Contract notes
response_format.typeshould betext,json_object, orjson_schema.- For
json_schema, include a schema object (response_format.json_schema.schemaon chat-style payloads, ortext.format.schemaon responses-style payloads). - Validate JSON on your server before downstream use.
Design your schema
Start with a small object, mark required fields explicitly, and use enums for known categories. SetadditionalProperties: false when extra keys must be rejected. Keep the requested schema and your server validator in sync; version them together.