Skip to content
ReviewRamble

The weekly brief

AI, reviewed, in your inbox.

  • New reviews of tools, models, MCP servers and repos, with the verdict up front
  • Re-checked prices and ratings when something changes
  • New analysis pieces as they are published

Models, agents, MCP servers and the tools actually worth your time.

One email a week. Unsubscribe with the link in any brief. How we use your email

Structured output

Structured output is an API feature that makes a language model's reply follow a format you define, usually a JSON schema, so that code can parse it reliably instead of scraping free text.

Also called: JSON mode, JSON schema output, structured outputs

By Divya Sharma · Checked Nov 15, 2026 · How we review

When a model's answer feeds into code, free text is fragile. A missing bracket, an extra sentence or a renamed field breaks the parser. Structured output solves this by giving the model a schema and having the API return only replies that match it.

How it works

You send a JSON schema with the request, listing the fields, their types and which are required. Providers that support strict structured output use constrained decoding: at each step the model may only produce tokens that keep the reply valid against the schema. Anthropic's documentation says this guarantees schema-compliant responses, with no JSON parsing errors and required fields always present.

JSON mode versus schema output

A plain "JSON mode" only asks for syntactically valid JSON. The reply parses, but fields can still be missing or have the wrong type. Schema-based structured output checks the shape as well. Without either, you rely on prompt engineering, validation and retries.

Example

An invoice extractor might define fields for vendor, date, total and currency. The model returns an object with exactly those keys, which can go straight into a database after validation.

How it differs from function calling

Function calling asks the model to choose a tool and fill in its arguments. Structured output shapes the final answer itself. Both use schemas, and some providers offer a strict mode for tool arguments too.

Limits

A valid shape is not a correct answer: the model can still put a wrong value, or a hallucination, in a well-formed field, so check content as well as format. Providers support different subsets of JSON Schema, so check which keywords your provider accepts.

Related terms

Tool calling
Tool calling, also called function calling, is a model API feature where you describe functions with a schema, the model replies with a structured request to call one, and your code runs it and returns the result.
Prompt engineering
Prompt engineering is the practice of writing, structuring and testing the instructions and examples given to a language model so that it produces the output an application needs, without changing the model's weights.
Hallucination (AI)
A hallucination is output from an AI model that sounds fluent and confident but is false, unsupported by its sources or made up, such as an invented citation, quote, statistic or API function.
Guardrails (AI)
Guardrails are runtime checks placed around a language model that inspect inputs and outputs and block, rewrite or redirect them, so an application stays on topic, avoids harmful content and follows rules the model alone would not reliably keep.

Sources