OpenRouter Maps Three Routes to Reliable LLM Structured Output
OpenRouter recommends choosing among strict JSON Schema, forced schema-based tool calls, and decision models according to model and endpoint support. In its vendor-reported test using 24 messy support messages across nine structured-output models and GLM 5.3 FlashX, 209 of 216 strict-schema replies matched the schema, while all seven failures came from one provider. The guide also recommends enforcing required parameters, repairing broken JSON, and validating every response because some endpoints return successful responses that violate the schema.
The guide provides a practical compatibility strategy for developers routing LLM structured-output requests across providers whose schemas, tools, and enforcement behavior differ.
How to Get Structured Output from Any LLM: JSON Schema, Tool Calls, or a Decision Model
OpenRouter ·11/10/2026


When your code reads fields from a model’s reply, like an order ID or a refund amount, it expects clean JSON every time. Most of the time, it gets it. But now and then the model wraps the JSON in a code fence, adds a field you didn’t ask for, or sends a number as text, and your code breaks. If you use several models, one fix won’t cover them all, because each model and provider handles structured output in its own way.