What is Structured Output?
A technique for constraining a language model's response to conform to a specific schema such as JSON, ensuring machine-parseable results.
Structured output refers to mechanisms that force a language model to generate responses matching a predefined format—typically JSON conforming to a JSON Schema, but also XML, YAML, or other structured formats. This is achieved through grammar-constrained decoding, schema-guided generation, or post-processing validation. Structured output is essential for integrating language models into software pipelines where downstream consumers expect reliable, typed data rather than free-form text. It eliminates parsing ambiguity, reduces error handling complexity, and enables direct serialization into application data structures.