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

# Perplexity with Agno

> Use Perplexity's Agent API through Agno's OpenAI Responses integration.

export const SonarDeprecationNotice = ({showGuideLink = true}) => <Warning>
    Sonar Chat Completions is now <a href="/docs/agent-api/quickstart">Agent API.</a> Sonar will be supported until September 27, 2026.{showGuideLink && <> Migration guide <a href="/docs/agent-api/migrate-from-sonar/overview">here</a>.</>}
  </Warning>;

<SonarDeprecationNotice />

## Overview

[Agno](https://docs.agno.com) is an open-source Python framework for building agents, teams, and workflows. Connect it to Perplexity's [Agent API](/docs/agent-api/quickstart) through Agno's OpenAI Responses-compatible model class.

## Installation

```bash theme={null}
pip install agno openai
```

## API Key Setup

Set your Perplexity API key as an environment variable:

```bash theme={null}
export PERPLEXITY_API_KEY="your_api_key_here"
```

<Card title="Get API Key" icon="key" href="https://console.perplexity.ai/project/keys">
  Generate your Perplexity API key from the API portal.
</Card>

## Quick Start

Use `OpenAIResponses` with the Agent API base URL and any supported Agent API model. Pass a research [preset](/docs/agent-api/presets) through `extra_body` so answers are grounded in live web results:

```python theme={null}
import os

from agno.agent import Agent
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(
        id="openai/gpt-5.6-luna",
        base_url="https://api.perplexity.ai/v1",
        api_key=os.environ["PERPLEXITY_API_KEY"],
        extra_body={"preset": "medium"},
    ),
    markdown=True,
)

agent.print_response(
    "What are the latest breakthroughs in fusion energy this year?",
    stream=True,
)
```

Swap `id` for any [Agent API model](/docs/agent-api/models) to route third-party models through Perplexity. The Agent API also provides research-backed [presets](/docs/agent-api/presets) and additional built-in [tools](/docs/agent-api/tools).

## Links & Resources

<CardGroup cols={2}>
  <Card title="Agno OpenAIResponses Docs" icon="book" href="https://docs.agno.com/models/providers/native/openai/responses/usage/basic">
    Configure Agno's OpenAI Responses-compatible model.
  </Card>

  <Card title="Agent API Models" icon="sparkles" href="/docs/agent-api/models">
    Browse supported models and pricing.
  </Card>

  <Card title="Agno Docs" icon="globe" href="https://docs.agno.com">
    Learn more about agents, teams, and workflows in Agno.
  </Card>
</CardGroup>
