> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Task API: Output Schema Types

> Compare the Parallel Task API's auto, JSON, string, and text output schemas on one research query.

The Task API supports 4 output schema formats. This cookbook demonstrates each type.

```python output_schemas.py theme={null}
"""
Task API — Output Schema Types
==============================

The Task API supports 4 output schema formats.
This cookbook demonstrates each type.

Output Schema Types:
1. Auto — Parallel determines structure
2. JSON Schema — Enforce specific fields
3. String — Natural language description
4. Text — Markdown report with citations

Prerequisites:
- pip install parallel-web
- export PARALLEL_API_KEY=<your-api-key>
"""

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.parallel import ParallelTools

# =============================================================================
# 1. AUTO SCHEMA
# =============================================================================
# Let Parallel determine the best output structure.
# Good for exploratory research where you don't know the format upfront.
# NOTE: Auto schema requires "pro" processor or higher.

auto_tools = ParallelTools(
    enable_search=False,
    enable_extract=False,
    enable_task=True,
    default_processor="pro",  # Auto schema requires pro+
    default_output_schema={"type": "auto"},
)

auto_agent = Agent(
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[auto_tools],
    markdown=True,
)

# =============================================================================
# 2. JSON SCHEMA
# =============================================================================
# Enforce specific fields with types.
# Best for data enrichment and structured extraction.

json_tools = ParallelTools(
    enable_search=False,
    enable_extract=False,
    enable_task=True,
    default_output_schema={
        "type": "json",
        "json_schema": {
            "type": "object",
            "properties": {
                "company_name": {"type": "string"},
                "founding_year": {"type": "string"},
                "total_funding": {"type": "string"},
                "valuation": {"type": "string"},
                "key_investors": {
                    "type": "array",
                    "items": {"type": "string"},
                },
            },
            "required": ["company_name"],
        },
    },
)

json_agent = Agent(
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[json_tools],
    markdown=True,
)

# =============================================================================
# 3. STRING SCHEMA
# =============================================================================
# Natural language description of expected output.
# Simpler than JSON Schema, more flexible.

string_tools = ParallelTools(
    enable_search=False,
    enable_extract=False,
    enable_task=True,
    default_output_schema="Return the company name, founding year, total funding raised, current valuation, and list of major investors",
)

string_agent = Agent(
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[string_tools],
    markdown=True,
)

# =============================================================================
# 4. TEXT SCHEMA
# =============================================================================
# Markdown report with embedded citations.
# Best for long-form research reports.

text_tools = ParallelTools(
    enable_search=False,
    enable_extract=False,
    enable_task=True,
    default_output_schema={"type": "text"},
)

text_agent = Agent(
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[text_tools],
    markdown=True,
)

# =============================================================================
# RUN
# =============================================================================
if __name__ == "__main__":
    # Using JSON schema for structured company data
    json_agent.print_response(
        "Research Anthropic: funding history and key investors.",
        stream=True,
    )
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai parallel-web
```

**2. Export your API keys**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
export PARALLEL_API_KEY="your_parallel_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
$Env:PARALLEL_API_KEY="your_parallel_api_key_here"
```

**3. Run the example**

Save the code above as `output_schemas.py`, then run:

```bash theme={null}
python output_schemas.py
```

Full source: [cookbook/91\_tools/parallel/output\_schemas.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/91_tools/parallel/output_schemas.py)


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