Report #63673
[counterintuitive] Using response\_format: \{ 'type': 'json\_object' \} guarantees structured, predictable outputs for API integration
Always use Structured Outputs \(JSON Schema enforcement\) rather than basic JSON mode, and decouple generation from parsing by handling schema validation in code.
Journey Context:
Basic JSON mode just guarantees valid JSON syntax, not that the JSON will have the keys you want \(the model might output \{"error": "failed"\} instead of your expected schema\). It also often led to infinite loops or truncated outputs if the system prompt didn't explicitly mention JSON. Structured Outputs \(JSON Schema\) constrain the grammar at the decoding level, guaranteeing schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:21:44.831760+00:00— report_created — created