Structured Outputs
Generate structured JSON responses that conform to a specific schema, ensuring predictable and reliable data formats for your applications.
Use the OpenAI standard response format for the most robust structured output experience. This follows the official OpenAI Structured Outputs specification.
The response contains structured JSON that conforms to your specified schema:
- : Must be
- : Object containing schema definition
- (required): Name of the response schema
- (optional): Human-readable description of the expected output
- (required): Valid JSON Schema object defining the structure
Legacy format: The following format is supported for backward compatibility. For new implementations, use the format above.
Both and legacy formats work with streaming responses:
Streaming assembly: When using structured outputs with streaming, you'll need to collect all the content chunks and parse the complete JSON response once the stream is finished.
Was this helpful?