Report #25414
[counterintuitive] Begging for JSON in the prompt \('Return ONLY valid JSON, no markdown'\)
Use the API's native structured output features \(e.g., response\_format: \{ type: 'json\_object' \} or json\_schema\) and simply instruct the model to return the result as JSON.
Journey Context:
In 2023, developers spent hours crafting prompts to force JSON output, only to have models hallucinate markdown blocks or invalid syntax. Native JSON mode guarantees valid syntax and allows schema enforcement, making prompt-based JSON begging obsolete and fragile. If you rely on prompt text for JSON, any slight model update can break your parser.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T21:03:44.897038+00:00— report_created — created