🛠️Structured Output (LLM)
Also known as Structured Outputs, Schema-Constrained Output
The model's answer must fit a set shape, like JSON with set fields.
Think of it like
Think of it like a form with boxes. The answer has to go in the right boxes.
Example
Lucy's app reads receipts. She asks for JSON with a shop, a date and a total. Every reply has those three fields, so her code can save them straight to a database.
Why it matters
It is what lets a program use a model's answer safely. Free text is hard for code to read.
Definition
Example code
json
{
"shop": "Corner Bakery",
"date": "2026-03-14",
"total": 12.40
}Common mistake
Key takeaways
- 1A fixed shape. Fields set in advance.
- 2Enforced by the API. Replies always fit.
- 3Code can read it. No guessing.