Report #48223
[counterintuitive] Asking the model to 'Output ONLY valid JSON inside a \`\`\`json markdown block'
Use native API structured output features \(e.g., response\_format: \{ type: 'json\_object' \}\) and request raw JSON without markdown wrappers.
Journey Context:
In 2023, wrapping JSON in markdown was the only reliable way to get structured data. Modern APIs have native structured output generation that guarantees schema adherence at the token level. Asking for markdown wrappers forces the model to generate backticks, which breaks strict JSON parsers unless you strip them, adding unnecessary post-processing and risking format errors. Native structured outputs bypass the parser entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:25:04.560344+00:00— report_created — created