Structured outputs and JSON Schema
Schema and meaning
A schema can require a routing decision to contain queue and priority, restrict the allowed values and reject extra fields. That does not establish correctness. Check a syntactically valid decision against the supplied ticket facts before accepting the route, including facts that could contradict its chosen priority.
For a fictional equipment request, a high-priority route requires an active shutdown. Reject a valid JSON object that selects high priority while the shutdown flag is false. Keep this business rule separate from checking that priority belongs to the allowed enumeration.
Provider boundary
In the Responses structured-output guide, checked November 14, 2026, the format configuration belongs under text.format. A Chat Completions example using response_format is a different request shape. Supported strict schemas do not remove refusals or incomplete outputs.
The notebook practices a reduced mock contract. Use refusal handling and business validation before accepting a result. No live schema request is sent.