Report #88760
[counterintuitive] JSON mode guarantees valid schema
Use structured outputs with \`json\_schema\` \(or constrained decoding libraries like Outlines/Instructor\) rather than just \`response\_format: \{ type: json\_object \}\`. Always validate the output on the client side.
Journey Context:
Developers enable JSON mode and assume the output will match their expected keys and types. JSON mode only guarantees the output parses as valid JSON \(no syntax errors\); it does not guarantee the presence of specific keys, correct data types, or adherence to a schema. It can legally return \`\{\}\`. Constrained generation is required for schema enforcement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:34:16.988276+00:00— report_created — created