How it works
Rather than parsing free text, you pass a JSON Schema (or a Zod or Pydantic model that the SDK converts) describing the fields you want, such as name, email and a priority from a fixed list. With strict structured outputs, offered by OpenAI, Google and Anthropic, the provider constrains generation so the reply always parses and matches the schema. Older 'JSON mode' only promised valid JSON, not the right fields.
It turns a model into a dependable component: extracting invoice fields, tagging support tickets, filling a form from an email, or returning a plan an agent can carry out. The shape is guaranteed but the content is not, so values still need validation and business rules (an extracted total can be wrong even when it is a valid number). Keep schemas small and descriptive, since field names and descriptions guide the model.
Related terms
More in AI and LLMs
Building with models