Home › Key concepts › Structured output

Key concept · Crawl (beginner) · the same on every platform

Structured output

Ask the model for JSON in a fixed shape, then check it in code.

What it is

Instead of free text, you give the model a schema (fields and types) and ask it to answer in that shape. Your code validates the result and retries or fails clearly if it does not fit.

Why it matters

Free text is hard to use safely. A checked structure can go straight into code and databases.

An example

From an email, the model returns {"claim_date": "2026-10-12", "vehicle": "KA01AB1234"} and code checks the date is not in the future.

The common mistake

Parsing the model's prose with regular expressions and hoping.

Where you meet it on each platform

The idea stays the same; only the product name changes.

JobAWSAzureGoogle CloudDatabricksOpen source
Prompts and structured outputask clearly and get JSON back you can checkBedrock Converse APIFoundry structured outputsGemini controlled generationai_query + structured outputPydantic + JSON mode

Related ideas

Where it shows up

Part of the Crawl level on these paths: AI Engineering (working with models).