Report #98550
[counterintuitive] Telling the model to 'output JSON' and parsing the response is a reliable structured-output strategy
Use the API's Structured Outputs \(json\_schema response format\) or function calling with strict schemas. These enforce schema conformance at the API level instead of fragile text parsing.
Journey Context:
JSON mode only guarantees valid JSON, not schema adherence; models can omit or rename fields. OpenAI Structured Outputs uses constrained decoding to match a JSON Schema. Function calling is the right choice when the model needs to call tools; response\_format is for final user-facing structured data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T05:09:45.455425+00:00— report_created — created