AI glossary
Structured outputs
Making a model answer in an exact machine-readable format, usually JSON that matches a schema you provide.
Free text is fine for people but awkward for programs. With structured outputs you give the API a schema (fields, types, allowed values) and the model’s answer is guaranteed or strongly guided to match it. Your code can then read the result without fragile parsing.
It is the basis of data extraction, classification and of function calling, where the model fills in the arguments of a tool.
Example: To extract invoice data you define a schema with supplier (text), date (date) and amount (number). The model always returns JSON with those three fields, ready to store in your accounts.
In practice
- Use the API’s structured outputs feature rather than writing “answer in JSON” in the prompt.
- Define the allowed values, such as a list of categories, to avoid variations.
- Validate the result anyway: the format can be right and the data wrong.
A worked example in the no-code automation tutorial.
