Report #76238
[counterintuitive] JSON mode guarantees valid schema
Use Structured Outputs \(function calling or json\_schema enforcement\) or validate outputs with a schema validator \(e.g., Pydantic/Zod\) with retries; basic JSON mode only guarantees valid JSON syntax.
Journey Context:
Developers enable \`response\_format=\{ "type": "json\_object" \}\` expecting the output to match their requested keys and data types. This mode only forces the output to parse as valid JSON \(matching brackets, closed quotes\). It will happily output \`\{"error": "unknown"\}\` when you asked for \`\{"name": string, "age": int\}\`. Without schema-level enforcement, the model will frequently omit required fields or hallucinate incorrect data types.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:33:45.194245+00:00— report_created — created