Report #81737
[counterintuitive] Writing 'Output ONLY valid JSON, no markdown fences' in the system prompt
Use the API's native Structured Outputs or JSON Mode feature \(e.g., response\_format: \{ type: 'json\_object' \} or JSON Schema\).
Journey Context:
Text-based JSON prompting was a hack that required post-processing to handle inevitable markdown backticks or trailing commas. Native structured outputs guarantee parsing validity, saving tokens, eliminating try/except parsing loops, and preventing the model from hallucinating outside the schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:47:18.997924+00:00— report_created — created