Skip to main content
Structured outputs let you define a JSON schema that the model must follow. Use them when your application needs predictable output fields, enums, and nesting.

Use structured outputs when

  • the model is responding directly to your application
  • you need valid JSON in a known shape
  • retries and post-processing are too brittle

Do not use structured outputs when

  • the model is supposed to decide which tool to call
  • you are building a tool-use or function-calling loop
That is the boundary:
  • Structured outputs shape the assistant response
  • Function calling / tool use shapes how the model interacts with external functions

Core pattern

Use response_format with a json_schema, and keep the system instruction explicit about responding in JSON.

Strong use cases

  • extraction and classification
  • scoring and evaluation outputs
  • UI generation from model responses
  • typed automation pipelines