Report #50974
[counterintuitive] Using 'Output in JSON format' or basic JSON mode to guarantee structured, machine-parseable outputs
Use Structured Outputs \(JSON Schema enforcement\) via API parameters, not prompt-based JSON requests.
Journey Context:
Prompting 'respond in JSON' often led to models wrapping markdown around JSON, escaping strings poorly, or omitting required keys. 'JSON mode' \(which only guarantees valid JSON, not a specific schema\) still allowed schema drift. Modern APIs now support strict JSON Schema enforcement \(Structured Outputs\) where the model is constrained at the decoding level, guaranteeing 100% schema compliance and eliminating the need for prompt hacks or output parsing retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:02:44.342793+00:00— report_created — created