← All terms

Structured Output

A model response constrained to a defined, machine readable format such as JSON.

What Is Structured Output

Structured output refers to a response from an AI model that is constrained to a defined, machine readable format, most commonly JSON, rather than free form prose. Instead of writing a paragraph that a human or another program has to interpret, the model produces a response whose fields, types, and layout follow a schema agreed on ahead of time, which makes the response straightforward to parse and use programmatically.

How It Works

A schema describing the expected output, such as a JSON Schema listing field names, types, and which fields are required, is provided to the model along with the task. The model is instructed, and in some systems technically constrained at the decoding level, to produce a response that matches that schema. Once generated, the response can be validated against the schema automatically: a validator checks that every required field is present, that values have the expected type, such as a string, number, or nested object, and that no constraints, such as an enumerated set of allowed values, are violated. Responses that fail validation can be rejected or sent back for correction rather than passed downstream.

Structured Output vs Free Text

Free text is well suited to explanations, summaries, and anything meant primarily for a human reader, since it allows natural phrasing and variable length. Structured output trades that flexibility for predictability: the same field will always appear in the same place with the same type, which is what a downstream program needs to consume the result reliably. Many agent systems support both and let the caller choose per task, since forcing every response into a rigid schema is unnecessary overhead for tasks that are naturally conversational or open ended.

Why It Matters

As AI agents are wired into larger automated systems, whether that is updating a database, triggering a workflow, or feeding another agent, the reliability of their output format becomes as important as the correctness of its content. Structured output turns a model's response into something closer to a typed function return value than a block of prose, which reduces the amount of custom parsing and error handling a calling system needs and makes agent behavior easier to test.

Related Concepts

Structured output is closely related to the concept of an output contract, which is the task level specification declaring whether a response should be free text or must validate against a particular schema. The contract is the requirement; structured output is the result that satisfies it.

Get started

Deploy your fleet.

Put a fleet of sandboxed agents to work on your own infrastructure, provisioned in seconds and watched live from one console.

Get started

Admin-provisioned · Self-host in one command · Your data never leaves your VM