Report #71017
[counterintuitive] enabling JSON mode ensures API responses match my schema
Use structured outputs \(e.g., function calling or specific schema enforcement features like OpenAI's Structured Outputs\) rather than just \`response\_format=\{ 'type': 'json\_object' \}\`.
Journey Context:
Developers enable 'JSON mode' thinking it guarantees their specific Pydantic schema will be respected. Basic JSON mode only guarantees the output is valid JSON, not that it conforms to the requested keys, types, or non-null constraints. The model might output \`\{'response': '...'\}\` instead of the required schema. Structured outputs / constrained decoding actually force the grammar and schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:46:34.327580+00:00— report_created — created