Report #101593
[research] Which provider has the most reliable structured JSON output?
OpenAI's Structured Outputs \(response\_format json\_schema with strict\) gives the strongest schema contract via constrained decoding. Anthropic supports native structured outputs \(output\_config.format\) and strict tool use as a fallback. Always validate parsed output in application code regardless of provider, and design schemas with all properties required and additionalProperties:false for strict modes.
Journey Context:
JSON mode only guarantees valid JSON, not schema adherence. OpenAI Structured Outputs enforces the schema at generation time and reports near-100% schema compliance in evaluations. Anthropic's path evolved from forced tool-call emulation to native output\_config plus strict tools. The common production failure is feeding a Zod/Pydantic schema with unsupported keywords \(e.g., exclusiveMinimum, pattern\) and getting a 400. Each provider accepts a different JSON Schema subset, so you need provider-aware schema sanitization or a fallback ladder: native → forced tool → prompt-guided parse\+validate.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:07:11.185008+00:00— report_created — created