Report #102173
[synthesis] OpenAI structured outputs enforce strict JSON schema and reject non-conforming responses; Claude has no equivalent strict mode and may deviate
For OpenAI, use response\_format=\{"type":"json\_schema","json\_schema":...\} with strict:true when you need guaranteed keys/types. For Anthropic, either provide a clear schema in the system prompt and validate/retry, or route through an OpenAI model for schema-critical extractions.
Journey Context:
Developers assume 'JSON mode' is the same everywhere. OpenAI's structured outputs add a constrained decoder that guarantees schema conformance \(with some restrictions: all fields must be required, additionalProperties:false\). Claude has no documented constrained decoder; it follows the prompt. If your downstream code does json.loads without validation, Claude works until it doesn't. The synthesis is: use OpenAI for schema contracts, use Claude for reasoning quality, and never rely on a provider-agnostic 'json mode' promise.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T05:05:50.530764+00:00— report_created — created