In 2023 we prayed for clean JSON. In 2026 we force it.
Three techniques
- Schema-guided generation — native in OpenAI/Anthropic APIs, 100% guaranteed with strict mode.
- Tool use as surrogate — force a specific tool call with your desired schema.
- Instructor / constrained decoding — validate + retry pattern for open-source models.