Insight · November 20, 2026
What is
structured output?
The feature that turns a model from a prose generator into a reliable component. Force the answer to match a schema, and the code downstream can finally trust its shape.
01 · The definition
A guaranteed shape, not a hopeful one.
Structured output is a feature that forces a model to return data in an exact shape you define, usually a JSON schema. Instead of hoping the model formats its answer correctly, you hand it the schema, and the system guarantees every response matches it: the right fields, the right types, valid every time.
It exists because a model that writes free text is awkward to build on. A person can read a paragraph and pull out the three facts that matter. Code cannot, not reliably, not when the wording shifts between calls. Structured output removes the guesswork by making the format part of the request rather than something you clean up after the answer arrives.
02 · How it works
The invalid paths are closed before a word is picked.
The naive version of this is prompting. You ask the model to reply in JSON and hope it complies. It usually does, and then one call in fifty comes back with a trailing comma, a missing quote, or an apology wrapped around the data, and the parser downstream falls over. Structured output is a different mechanism, not a politer request.
It works through constrained decoding. A model builds its answer one token at a time, choosing from the whole vocabulary at every step. Constrained decoding narrows that choice. At each step the system masks out any token that would break the schema, so the model can only pick from the tokens that keep the output valid. The answer cannot drift off the structure, because the paths that lead off it are closed before a word is chosen.
The providers describe the same approach in their own documentation. Anthropic says its structured outputs guarantee schema compliant responses through constrained decoding, using constrained sampling with compiled grammar artifacts. OpenAI frames its version as making the model always generate responses that adhere to your supplied JSON schema. The schema is compiled into a set of rules the decoder follows, and the rules do the enforcing.
The one line to keep
“A model that must match a schema stops being a writer you clean up after and becomes a component you can build on.”
03 · What it guarantees
Four things the schema holds, and one it does not.
01
Valid every time
The output always parses. Anthropic lists it first among the guarantees of its structured outputs: always valid, no JSON parsing errors. The retry loop that used to wrap a model call, catching the half written brace and asking again, goes away.
02
The right shape, not just valid syntax
JSON mode only promised that the text was legal JSON. Structured output promises the schema. In OpenAI’s words it constrains the shape of the JSON, not only its validity: the fields you named, the types you set, the ones you marked required.
03
A contract the next step can trust
Downstream code reads fields by name and knows their type before the response arrives. The model stops being a wall of prose that something has to parse and becomes a typed component the rest of the system can build on.
04
Still only the shape
A schema cannot check that a value is true. The structure is guaranteed. The content is not. An email field will hold a string shaped like an email, not proof that it is the right one. Checking meaning stays a job for your code.
04 · The older feature it replaced
JSON mode guaranteed syntax. This guarantees the schema.
Before structured output there was JSON mode, and the two get confused. JSON mode made a promise worth having but narrow: the text that came back would be valid JSON. It would parse. What it did not promise was the shape. You could still get the right syntax wrapped around the wrong fields, a number where you wanted a string, or a key you never asked for.
Structured output closes that gap. OpenAI draws the line directly: the older setting only specified that the model should return valid JSON, while the newer one, as it puts it, constrains the shape of the JSON, not only its validity. Enforcement is switched on with a strict flag and a schema passed on the request. The difference sounds small and is not. Valid but wrong shaped JSON still breaks the code that reads it.
Every major provider now ships a native version of this. OpenAI and Anthropic both take a JSON schema on the request and enforce it at decode time. Google's Gemini takes a response schema, drawn from a subset of the OpenAPI standard, alongside a JSON response type. For models a team hosts itself, open libraries such as Outlines, maintained by .txt, apply the same constrained generation. They differ in which corners of the JSON schema standard they accept, so a schema that one provider enforces may need trimming for another.
05 · One example that shows the whole idea
The same task, asked and then enforced.
Pull the details out of an invoice. Ask a model in plain words for the vendor, the total, and the due date, and most of the time you get them. But the total comes back as a number on Monday and a string with a currency sign on Tuesday, the due date arrives in three different formats, and once in a while the model adds a friendly sentence that your parser was not built to read.
Hand it a schema instead. Vendor is a string. Total is a number. Due date is a string in a date format. All three are required, and nothing else is allowed. Now every response is the same object with the same keys and the same types, call after call. The code that files the invoice reads three fields and never reaches for a regular expression. The model did the reading. The schema fixed the shape.
asked "pull the vendor, total, and due date"
→ { "total": "$1,240.00" } one day
→ { "total": 1240, "note": "hope this helps" } the next
enforced schema: vendor string · total number · due_date date
→ { "vendor": "Acme", "total": 1240, "due_date": "2026-11-30" }
→ the same shape, every single callSame model · same task · one schema deciding the shape
06 · The operator view
A valid shape is not a correct answer.
The trap is to read a guarantee of shape as a guarantee of truth. A schema makes sure the total field holds a number. It cannot make sure the number is the right total. The model can still read the invoice wrong and return a clean, well typed, confidently incorrect object. Structured output removes a whole class of parsing failures and none of the reasoning ones.
So the shape is the floor, not the finish. The providers are honest about this. Anthropic notes that its local checks confirm you have not used an unsupported schema feature, but the values themselves are not validated for you. The schema is the start of your validation, not the end of it. Checking that a value is plausible, that a total matches the line items, that a date is in range, is still your code's job.
Structured output pairs naturally with the other controls on a model call. It is how the result of tool calling stays machine readable, and it sits one layer in from a guardrail, which checks the content a schema cannot. The standing rules for a call, the ones set in the system prompt, decide what the model should produce. The schema decides the shape it comes back in.
07 · Where the model meets the work
One schema, enforced the same way everywhere.
In a real product the schema is not a detail typed into one call. It is a contract between the model and everything downstream of it, and it has to hold no matter which model answered. When a system calls more than one provider, each accepting a slightly different slice of the schema standard, keeping that contract stable across all of them is the actual work.
That is the layer Bttr. builds. We build the Token Control Plane, “the middle layer between you and every AI vendor,” where the rules for every model call live in one place. A schema becomes a contract the system enforces once, rather than a shape re-specified and re-checked at a hundred different call sites.
Closing
Stop parsing the answer. Define its shape.
Structured output moves the format from something you hope for to something the system holds. The shape arrives guaranteed, every call, so the code that reads it can stop defending against surprise. The meaning inside that shape is still yours to check. That is the line worth keeping straight: the schema settles the form, never the truth.

Written by · November 20, 2026
Donny Smith · Founder & Executive Creative Director, Bttr.
Over the past 15 years, he has led creative teams and contributed to products used by millions of people worldwide, working with companies including Apple, Opendoor, JP Morgan, GE Aerospace, Pepsi, and Alterra Mountain Company.
LinkedInAnthropic · Structured outputs, Claude Platform docs · 2026 · OpenAI · Structured Outputs Intro, OpenAI Cookbook · 2026 · Google · Structured output, Gemini API docs · 2026 · dottxt · Outlines, structured generation library · 2026 · Thoughtworks · Structured output from LLMs, Technology Radar, Adopt · April 2026 · Facts current as of November 20, 2026.
Share this perspective
More insights
Adjacent perspectives.
Bttr. Field Brief
The brief Bttr. writes for senior buyers.
Monthly. One signal worth your time on Brand Operating Systems, AI search visibility, and the infrastructure buildout. No filler.