What is an output schema?
What is it?
An output schema is a JSON Schema describing exactly the shape of the expected answer: which fields, which types, which are required. Recent models can follow it (structured outputs).
When to use it
- Extract data from text (invoice, CV, email) in a reliable format.
- Plug a model's answer straight into a program.
Page fields
| JSON Schema | The schema, of type object. |
|---|---|
| Instructions | What the model should do with the text. |
| Example | A valid output. |
How to use it
The Python example passes the schema to the Anthropic API; the OpenAI format is provided too.