Skip to main content

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 call

Same 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.

Donny Smith

Written by · November 20, 2026

· 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.

LinkedIn

Share this perspective

More insights

Adjacent perspectives.

What Is Temperature in AI

7 min read

What Is Temperature in AI

Temperature is a setting that controls how random a language model’s output is. At each step the model scores every word it knows, turns those scores into probabilities with a softmax, and temperature is applied inside that step: it divides each score before the probabilities are worked out, which sharpens or flattens the gap between the leading word and the rest. A Hugging Face guide to text generation describes the move as making the distribution sharper by increasing the likelihood of high probability words and decreasing the likelihood of low probability ones, and notes that as temperature approaches zero the sampling becomes equal to greedy decoding, where the model takes its single highest scoring word every time. OpenAI’s API documentation puts the range between 0 and 2, says higher values like 0.8 make the output more random while lower values like 0.2 make it more focused and deterministic, and recommends altering temperature or top_p but not both. The catch most teams miss is that a low number is not a lock. Anthropic states in its glossary that even with temperature set to 0 the results will not be fully deterministic, and identical inputs might produce different outputs across API calls. The operator rule follows: run cold when the work has one right answer, run warm when you want range, and never read a warmer setting as a smarter model.

What Is a Multimodal Model

7 min read

What Is a Multimodal Model

A multimodal model is an AI system that takes in and reasons across more than one kind of data, such as text, images, audio, and video, inside a single context. It maps each input into one shared representation, so it can relate a word, a picture, and a sound as parts of the same thing. The distinction that matters is how it is built. When Google launched Gemini in December 2023, it noted that the standard approach trained separate components for each modality and then stitched them together, and said Gemini was instead pre-trained from the start on different modalities. OpenAI made the same move with GPT-4o in May 2024, a single model trained end to end across text, vision, and audio so that every input and output runs through one neural network, which is why it answers audio in about 320 milliseconds rather than the seconds of lag in a stitched voice pipeline. The operator rule follows: a native multimodal model keeps every sense in the same context, while a vision tool bolted onto a text model reasons only over what it already turned into words.

What Is Tool Calling

7 min read

What Is Tool Calling

Tool calling is how a language model acts on the world. You describe a function to the model as a name, a description, and a schema for its inputs. When a request needs it, the model does not answer in prose. It returns a structured call naming the function and its arguments, your code runs that call, and the result goes back so the model can answer from something real. Anthropic puts it plainly: tool use, also called function calling, lets a model call functions you define or that the vendor provides, and the model only decides what to run, never runs it. The names differ across vendors and the substance does not. OpenAI shipped the idea as function calling, Anthropic calls it tool use, and the Claude documentation settles the overlap in one line. This is the base layer under every agent, since each single act an agent takes is a tool call, and the Model Context Protocol standardizes the layer above it so one tool, described once, can be reached by any model that speaks the protocol.

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.