iCreatAI News
Skip to content
OpenRouter Announcements·· 5 days agoFeaturedAI score60

How to Get Structured Output from Any LLM: JSON Schema, Tool Calls, or a Decision Model

How to Get Structured Output from Any LLM: JSON Schema, Tool Calls, or a Decision Model

AI summary

The article compares three routes to reliable structured LLM output: a strict JSON Schema in response_format, a forced tool call whose parameters are the schema, and a decision model for label-only fields. In tests on 24 support messages across nine schema-supporting models plus GLM 5.3 FlashX, strict schemas returned 209 of 216 valid replies (all 7 misses from one provider that ignores the schema), while prompt-only JSON failed 18 times due to code fences. It recommends require_parameters: true, Response Healing for broken JSON, and always validating replies yourself.

Why it matters

A practical, test-backed guide to choosing between schema, tool-call, and decision-model approaches for structured LLM output.

Source: OpenRouter Announcements · openrouter.ai