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

# Perplexity (Provider)

# Perplexity (Web Search Provider)

The Perplexity plugin provides web search capabilities through the Perplexity
Search API or Perplexity Sonar via OpenRouter.

> [!NOTE]
>
> This page covers the Perplexity **provider** setup. For the Perplexity
> **tool** (how the agent uses it), see [Perplexity tool](https://agdiai-597e782f.mintlify.site/tools/perplexity-search.md).

* Type: web search provider (not a model provider)
* Auth: `PERPLEXITY_API_KEY` (direct) or `OPENROUTER_API_KEY` (via OpenRouter)
* Config path: `plugins.entries.perplexity.config.webSearch.apiKey`

## Quick start

1. Set the API key:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi configure --section web
```

Or set it directly:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
agdi config set plugins.entries.perplexity.config.webSearch.apiKey "pplx-xxxxxxxxxxxx"
```

2. The agent will automatically use Perplexity for web searches when configured.

## Search modes

The plugin auto-selects the transport based on API key prefix:

| Key prefix | Transport | Features |
| - | - | - |
| `pplx-` | Native Perplexity Search API | Structured results, domain/language/date filters |
| `sk-or-` | OpenRouter (Sonar) | AI-synthesized answers with citations |

## Native API filtering

When using the native Perplexity API (`pplx-` key), searches support:

* **Country**: 2-letter country code
* **Language**: ISO 639-1 language code
* **Date range**: day, week, month, year
* **Domain filters**: allowlist/denylist (max 20 domains)
* **Content budget**: `max_tokens`, `max_tokens_per_page`

## Environment note

If the Gateway runs as a daemon (launchd/systemd), make sure
`PERPLEXITY_API_KEY` is available to that process (for example, in
`~/.agdi/.env` or via `env.shellEnv`).


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