Skip to content

AI Glossary · Concepts

What is Structured Output?

Structured Output

Structured output means constraining a language model to return a fixed format, such as JSON that matches a schema, so that software can use the result reliably instead of parsing free text.

Also known as: structured outputs

· Updated · Chain of Thought

AI Engineering

  • 1 explainer
  • 1 episode
  • 1 source

Structured output gives software a predictable response shape. Anthropic’s documentation describes schema-constrained JSON output separately from strict validation of tool names and inputs. It also documents exceptions such as refusals and responses reaching a token limit (Anthropic, Structured outputs). Check the supported schema constraints and the response status for the API you actually use.

For example, an invoice extractor could return an invoice identifier, currency and amount. An application can validate the field names and types, then compare the amount with the invoice and its permitted business rules. The object {“currency”:“USD”,“amount”:100} may be valid JSON and still be wrong if the source says EUR 100. Passing a format check does not establish that the values came from the document.

Discussing tools for handling structured data inside an agent, Atindriyo Sanyal says, “tools that can help you parse JSON in a more deterministic manner.” (episode 11, 26:12).

The conversation concerns parsing and tool use rather than a claim about a particular structured-output API. For builders, separate parse failures, schema failures and incorrect values in your evaluation. Instruction adherence covers following constraints, tool use covers calling application functions, and how AI agents use tools follows a model decision into an action.

Sources

Go deeper

From the conversation