Report #78614
[counterintuitive] Pasting a JSON schema into the system prompt is the best way to get structured JSON output
Pass schemas via the API's native structured output parameters \(e.g., response\_format or tool definitions\) to enforce decoding constraints.
Journey Context:
Prompt-based schemas were brittle and prone to hallucination or syntax errors, requiring defensive parsing and regex. Native structured output features constrain the decoding process at the engine level, guaranteeing 100% valid JSON and schema adherence without wasting prompt tokens on schema definitions or retry loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:33:02.662488+00:00— report_created — created