All capabilities Building software
Get JSON that always matches your schema
Supply a schema and the model's response adheres to it - no missing required key, no invented enum value, no defensive parser.
DocsOfficially documentedTestNot tested by benchr
OpenAI APIGPT-5.6GPT-5.5GPT-5
Overview
- Constrains generation to the schema you supply rather than asking the model to please return JSON.
- Removes the retry loop most teams build around free-form JSON output.
- Makes an LLM step safe to put in the middle of a pipeline instead of at the end of one.
How it works
- 01Write the schema first and keep it flat. Deep optional nesting is where the unsupported-feature edges live.
- 02Send it on a supported model - the documentation says start new projects on gpt-5.6 and that support begins at GPT-4o.
- 03Handle the three documented escape hatches: refusals, safety rejections, and responses cut off by the token limit. A valid schema does not mean a completed response.
- 04Validate anyway at the boundary. Schema adherence is not the same thing as correct values.
Limits
- Not all of JSON Schema is supported; some features are excluded for performance or technical reasons.
- A refusal, a safety rejection, or hitting max tokens can still produce no usable object.
- With user-generated input that has nothing to do with the schema, the documentation warns the model will still try to fill it - which is a hallucination path, not a parse error.
- Structured output can still contain mistakes. The shape is guaranteed; the content is not.
Verification
benchr test runs
benchr has not run this capability. No test has been published.
benchr test runs →
Evidence
Sources
- OpenAI - Structured Outputs: the adherence guarantee and its documented edges Tier 1 · September 1, 2026
Not stated by the source
- Whether schema-constrained decoding changes answer quality on a given task
- Any latency overhead figure for schema enforcement
Source-check history
- September 1, 2026DocsOfficially documentedFirst logged. The adherence guarantee, the GPT-4o support floor, the gpt-5.6 recommendation and the three escape hatches were read from the guide.