Skip to main content
Structured outputs let you enforce machine-readable output instead of free-form text.

Endpoint support

Use structured outputs on:
  • /v1/chat/completions with response_format
  • /v1/responses with text.format
  • /v1/messages can still return JSON text, but does not use the same response_format contract

Request

Response

Contract notes

  • response_format.type should be text, json_object, or json_schema.
  • For json_schema, include a schema object (response_format.json_schema.schema on chat-style payloads, or text.format.schema on responses-style payloads).
  • Validate JSON on your server before downstream use.

Next guides

  1. Structured Output Schemas
  2. Validation and Fallback Patterns
Last modified on July 26, 2026