Report #76005
[counterintuitive] Typing 'Output only valid JSON' in the prompt to get structured data
Use the API's native JSON mode or Structured Outputs parameter with a defined schema. Do not rely on prompt text for syntax enforcement.
Journey Context:
Before native JSON modes, developers wrote long negative prompts \('DO NOT output markdown fences, NO trailing commas'\) and still faced ~5-10% failure rates requiring regex fallbacks. Native structured outputs use constrained decoding \(forcing the model to only generate tokens that fit the schema\), guaranteeing syntactic validity 100% of the time. Prompting for JSON is obsolete for any production system.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:09:52.639503+00:00— report_created — created