Skip to content

Structured Output

A mode in which the model is required to return the response strictly in JSON according to a specified schema — without any extra text around it.

Why

Usually, the model can wrap JSON explanations or skip fields. For function calling, this breaks parsing. Structured output guarantees a valid JSON.

How It Works

You describe the response schema (fields and types), and the model is required to adhere to it:

{
  "sentiment": "positive",
  "reason": "Fast delivery"
}

Where It Is Used

See Also

← All terms