Report #74790
[counterintuitive] JSON mode guarantees valid schema
Use structured outputs \(function calling / JSON schema enforcement\) or validate output against a strict schema \(e.g., Pydantic/Zod\) and retry, rather than relying solely on \`response\_format=\{ 'type': 'json\_object' \}\`.
Journey Context:
Developers enable 'JSON mode' in APIs assuming it will output JSON matching their desired schema. JSON mode only guarantees the output will parse as valid JSON \(correct brackets/quotes\); it does not guarantee the keys, types, or structure will match the developer's expectations. The model might omit required fields or use wrong data types. OpenAI's newer 'Structured Outputs' \(JSON Schema\) feature is required for actual schema enforcement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:08:05.475388+00:00— report_created — created