Structured output, often called JSON mode, is a way to ask an LLM to return data in a fixed machine-readable format instead of free-form text.
When you want an answer that another program can safely parse, plain chat text is fragile. A model might add extra words, change field names, or wrap the result in an explanation.
Structured output helps when you need:
In practice, teams reach for it when they want the model to behave more like a data generator than a conversational assistant.
There are two closely related ideas:
Official implementations vary by provider, but the general mechanism is the same: you give the model instructions plus a format constraint, and the system either:
This is different from “please respond in JSON” in plain natural language. A prompt alone may help, but it does not guarantee correctness. Structured output features exist to make that guarantee much stronger.
A useful mental model: the model is still generating text, but the platform is steering or checking that text against a contract.
Suppose you want to extract a support ticket summary:
Request
Return JSON with keys:
priority(low, medium, high),category, andsummary.
Response
{
"priority": "high",
"category": "billing",
"summary": "Customer was charged twice for the same invoice."
}
That output is easy for your code to parse because the shape is predictable.