Output schema
A formal definition of what fields and structure the model's output must have — often expressed as a JSON Schema, Pydantic model, or TypeScript type.
Think of it like
A blueprint: "The house has 3 bedrooms, 2 baths, 1 kitchen."
Example
Schema: {name: string, age: int, email: string}. Output must match this shape or be rejected.
How it actually works
Output schemas enable validation, parsing, and downstream automation. Combined with structured output or JSON mode, they're near-bulletproof. Define schemas in code (Pydantic, TypeScript) or spec languages (JSON Schema). Tools like Instructor or LangChain provide helpers.
For product teams
Zero-validation overhead. Machine-readable output by design.
For engineers
Define schema in your language. Use Pydantic, Zod, or JSON Schema. Validate every model output.
Related
- Structured output — Enforced via structured output and JSON mode.
- Format specification — Overlaps with format specification.
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome