JSON mode
JSON mode is a model setting that constrains generation so the response is always syntactically valid JSON.
JSON mode guarantees the output parses; it does not guarantee the fields are the ones you asked for or that the values are correct. Schema-constrained decoding goes further by enforcing the shape as well as the syntax.
Related terms
- Structured output
- Structured output is model output constrained to a machine-readable shape such as JSON, CSV, or a fixed schema, rather than free prose.
- Schema
- A schema is an explicit description of the fields, types, and structure that a model’s output must conform to.
More on prompt structure
See the full glossary, read the guides, or put it into practice in the prompt builder.