# Structured Output

> Structured output makes an LLM return data in a guaranteed shape — JSON matching your schema — so code can consume model responses without parsing prose.

**Structured output is getting typed, machine-consumable data from an LLM — the model's response constrained to match a schema you define, instead of prose your code has to parse and pray over.**

It's the feature that turns models into software components. Extraction, classification, routing, agent decisions — all of it wants `{"category": "billing", "priority": 2}`, not three paragraphs containing that information somewhere. Providers offer escalating guarantees: prompt-and-hope, **JSON mode** (valid JSON, arbitrary shape), and **schema-constrained generation** (decoding restricted so output *must* match your schema) — with [function calling](/glossary/function-calling) as the closely related mechanism where the "output" is a tool invocation.

The engineering around it: design schemas the model can fill well (described fields, enums over free strings — the [llm-output-schema-generator](/skills/api/llm-output-schema-generator) skill infers one from an example), validate semantics even when syntax is guaranteed, and wrap a validate-and-retry loop — the pattern libraries like [Instructor](/tools/instructor) and [BAML](/tools/baml) productize. Which guarantee to use when, per provider, is the [Structured Output vs JSON Mode vs Function Calling](/guides/concepts/structured-output-2026) decision guide.

---

_Source: https://agentscamp.com/glossary/structured-output — Term on AgentsCamp._
