Report #47507
[counterintuitive] Writing prompt instructions like 'Output ONLY valid JSON with no markdown' to get structured data
Use the API's native structured output parameters \(e.g., response\_format or tool definitions\) instead of relying on prompt text for format enforcement
Journey Context:
Before native JSON modes, developers had to beg models not to add backticks. Now, API-level grammar constraints \(like JSON Schema enforcement\) force valid JSON at the token level. Prompt-based JSON instructions are not only redundant but can conflict with the API's constrained decoding, causing weird truncation or escape-character issues.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:13:40.745578+00:00— report_created — created