Structured output
Structured output is model output constrained to a machine-readable shape such as JSON, CSV, or a fixed schema, rather than free prose.
Reliable structured output needs three things: an explicit schema in the prompt, an instruction to return only the data with no surrounding prose, and a rule for missing values so the model returns null instead of inventing one. Several APIs can enforce a schema directly, which is more reliable than asking.
Related terms
- Assistant prefill
- An assistant prefill is text placed at the start of the model’s own reply so that it continues from there instead of choosing its own opening.
- JSON mode
- JSON mode is a model setting that constrains generation so the response is always syntactically valid JSON.
- Schema
- A schema is an explicit description of the fields, types, and structure that a model’s output must conform to.
More on prompt structure
See the full glossary, read the guides, or put it into practice in the prompt builder.