ModelRefs / JSON Mode (Structured Output) — AI Glossary
JSON Mode (Structured Output) — AI Glossary
An inference mode where the model is constrained to return valid JSON — either free-form or matching a supplied schema.
Overview
Implemented via constrained decoding (outlines, guidance), grammar-based sampling, or response_format APIs. Eliminates a major class of parsing failures in agentic pipelines. OpenAI, Anthropic, and Mistral all support structured output.
Reference details
| Topic | prompting |
|---|---|
| Also known as | structured output, constrained decoding |
| Last reviewed | 2026-06-24 |
Related terms
Example: Valid JSON is not the same as the right JSON
Asked to extract an invoice total, the model returns {"total": 0} — perfectly valid, schema-conformant, and wrong, because the figure was in a footer it did not read. JSON mode removed the parsing failure and left the extraction failure untouched. Those are different problems and only one of them is solved here.
Commonly confused with
JSON mode and structured output are often used interchangeably but differ in strength. Plain JSON mode guarantees only that the output parses; schema-constrained output additionally guarantees the fields and types you declared. If you need a specific shape, asking for JSON is not enough.
When to use it
Reach for it when:
- The output is consumed by code rather than read by a person
- You need a parse failure to be impossible rather than rare
- Extraction into typed records
Reach for something else when:
- The reader is human — schemas make prose worse
- You are treating conformance as correctness and skipping evaluation
- The schema is deeply nested, where quality falls and latency rises
Referenced by
This term is used by the following ModelRefs references:
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to JSON Mode (Structured Output) — AI Glossary.
Frequently asked questions
What is JSON Mode (Structured Output)?
An inference mode where the model is constrained to return valid JSON — either free-form or matching a supplied schema.
Is JSON Mode (Structured Output) the same as structured output?
Yes — structured output, constrained decoding are common aliases for JSON Mode (Structured Output).
What concepts are related to JSON Mode (Structured Output)?
Closely related concepts include function calling, guardrails, output parser.