Index Ai Academy
Glossary · Phase 1 · Building with LLMs

JSON schema

Also written: JSON schemas

A precise description of the JSON you expect: which fields, what type each is, and which are required.

A JSON schema is the blank form. It describes the data you expect: which fields there are, and what kind of value goes in each one. The schema is itself written as JSON. In Python, that means a dictionary.

Try it now

An example response with structured output, trimmed. The JSON is a string inside the text block. A thinking block comes before it, and your code still needs to skip that.

Learn it properly

Structured output · Get reliable JSON back that your code can use. About 30 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write