Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Building with language models course

        A strict structured-output request

        Opening Building with language models
        Your turn

        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.

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.