Skip to main content
Structured outputs constrain the response to a JSON schema you supply in response_format, using the standard OpenAI parameter. Pass a Pydantic model through the SDK, or a raw JSON schema.

Pydantic models

JSON schema

Supported models

Structured outputs work on models whose supported_features include structured_outputs. Check GET /v1/models.
For models without native structured output support, use function calling with a single function whose parameters match your desired schema.

Function calling

Chat completions