All capabilities Building software

Constrain JSON output with a schema

Use provider-supported strict schema output, then handle refusals and incomplete responses before accepting the values.

DocsOfficially documentedTestNot tested by benchr Quick · API Docs checked October 15, 2026
OpenAI APIGPT-5.6 SolGPT-5.5GPT-5

Overview

  • Constrain completed structured responses to supported schema rules.
  • Separate response shape from checks on factual meaning and application requirements.
  • Expose refusal and incomplete-response paths at the integration boundary.

How it works

  1. 01Define a supported schema and keep the application type definition in sync with it.
  2. 02Choose an explicitly supported model and the correct schema field for your API surface.
  3. 03Check refusal, incomplete and error states before consuming a parsed object.
  4. 04Validate business rules and important values; schema adherence does not establish factual accuracy.

Limits

  • Only the documented JSON Schema subset is supported.
  • Refusals and token-limit truncation can leave no usable object.
  • Unrelated input can still produce invented values that fit the schema.
  • A well-formed object can contain incorrect values; retain application-level checks.

Verification

benchr test runs

benchr has not run this capability. No test has been published.

benchr test runs →

Evidence

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
  • October 15, 2026DocsOfficially documentedRe-read the structured-output guide. Removed unconditional completion and correctness claims; preserved the separate unverified execution status.
  • 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.

Changes

Provider changes affecting this