Structured outputs are a model capability that constrains a response, or a tool call's arguments, to a supplied schema, so the caller receives validated typed data instead of free-form text it has to parse defensively.
How it works
I supply a schema, and the model is constrained to emit output that conforms to it rather than merely being asked to. This applies in two places. The response itself can be held to a schema, so a field I expect is present and correctly typed. A tool call's arguments can also be held to a schema, often called strict tool use, so the arguments the caller receives match the required shape. On supported schemas the constraint is applied while the model generates rather than checked afterward, which is what separates it from prompting for JSON and validating whatever comes back, though some SDKs handle unsupported schema features by validating them after the response instead. The schema does the work a hand-written parser and a retry loop used to do. What the model still chooses is the content; what it no longer does on a completed, non-refused response is hand back a shape the caller never agreed to.
Why it matters
Free-form output forces every caller to become a defensive parser, and the parser is where silent breakage hides: a renamed field or a number returned as a string passes a glance and fails in production. Holding the output to a schema moves that fragility into a contract the model is constrained to honor, so the integration point stops being the weakest link in the pipeline. The catch is that a schema governs shape, not truth: a response can be perfectly valid against the schema and still wrong, so structured output makes data safe to consume, not correct. It also narrows what the model is allowed to say, which is the point when a program reads the result and a liability when a person does, so the capability earns its place wherever a machine, not a human, is the consumer.
In practice
A pipeline step needs the model to classify an input and return a category, a confidence, and a short reason for the next stage to act on. Rather than ask for JSON in the prompt and parse whatever returns, I bind the response to a schema with those three fields, so the next stage receives a typed object it can branch on directly. If the model has little to say it must still answer in the agreed shape, which is far easier to handle than an unexpected sentence the parser was not built for.
Practical considerations
Schema enforcement shows up on two surfaces that are easy to conflate: constraining the whole response, and constraining only a tool call's arguments; a single request can use either or both. Support and exact behavior vary by model and by provider, so a schema one model honors strictly another may treat as a strong hint, and a constraint like a required field or an enum is only as binding as the model's implementation of it. Very deep or very permissive schemas push work back onto the model and can degrade the quality of the content inside the valid shape, so a tight schema aimed at the fields the caller branches on beats an exhaustive one. A schema also couples the caller to a shape, so versioning it deliberately matters once more than one consumer depends on it. The capability removes most format parsing and format-repair retries, but a caller still handles the documented exceptions explicitly: a safety refusal or a response cut off at the token limit can come back non-conforming as a flagged status, and a provider may validate unsupported schema features after generation rather than during it. It also does not remove the separate, content-level check that the values inside the valid shape are sane.
Related standards and prior art
- Anthropic: structured outputs · continuously updated a response or a tool call is constrained to a supplied JSON schema, covering both JSON output and strict tool use
- OpenAI: structured outputs · continuously updated independent cross-vendor implementation: a response_format JSON schema with strict mode constrains the output to the schema for supported schemas and successful responses, with documented refusal and incomplete-output exceptions
Defined by Ready Solutions AI