> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dust.tt/llms.txt
> Use this file to discover all available pages before exploring further.

# Structured output format

> Make an agent answer in a fixed JSON format, so other tools and workflows can read its output.

Structured output makes an agent answer in a fixed JSON format that you define with a schema. Use it when another system reads the agent's answers, like a Zapier workflow or an API integration, and needs the same fields every time.

## Set up structured output

**1. Open the agent**

Open the agent in the Agent Builder.

**2. Pick a specific model**

In the **Instructions** section, open the model picker and click **More models** to choose a specific model that supports structured output. Auto models don't support it.

**3. Add the schema**

Click **JSON response**. In **Structured response format**, paste a valid JSON schema and click **Save**, then save the agent.

## Schema format

The schema must follow this structure:

```json JSON format theme={null}
{
  "type": "json_schema",
  "json_schema": {
    "name": "your_schema_name",
    "strict": true,
    "schema": {
      "type": "object",
      "properties": {
        "property1": { "type": "string" },
        "property2": { "type": "number" }
      },
      "required": ["property1", "property2"],
      "additionalProperties": false
    }
  }
}
```

## Example

A schema to extract city information:

```json structured output format example theme={null}

{
  "type": "json_schema",
  "json_schema": {
    "name": "city_info",
    "strict": true,
    "schema": {
      "type": "object",
      "properties": {
        "country": { "type": "string" },
        "state": { "type": ["string", "null"] },
        "city": { "type": "string" },
        "zipcode": { "type": "string" }
      },
      "required": ["country", "state", "city", "zipcode"],
      "additionalProperties": false
    }
  }
}
```

## Supported models

Not all models support structured output. The **JSON response** button is only enabled when the agent uses a specific model that supports it. Auto models (**Basic**, **Standard**, and **Premium**) don't support structured output, so pick a specific model to use it.

## Related

> [card] [Auto models and the model picker](https://docs.dust.tt/docs/user-documentation/agents/model-selection.md)
>
> Choose the model your agent uses.

> [card] [Create your first agent](https://docs.dust.tt/docs/user-documentation/agents/create-your-first-agent.md)
>
> Build an agent step by step in the Agent Builder.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.