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

# Perplexity

> Search the web and generate grounded, citation-backed answers with Perplexity Sonar models

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key comes from `PERPLEXITY_API_KEY`.
* **Docs**: [https://docs.perplexity.ai/getting-started/quickstart](https://docs.perplexity.ai/getting-started/quickstart)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable             | Required | Description                                                                                           |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `PERPLEXITY_API_KEY` | Yes      | Perplexity API key (starts with pplx-) [Docs](https://docs.perplexity.ai/getting-started/quickstart). |

## Setup

1. **Create a Perplexity account**: Go to [https://www.perplexity.ai](https://www.perplexity.ai) and sign up or sign in, then open the API section of your account settings.
2. **Add billing**: Add a payment method and credits in the API portal - API calls require a positive credit balance (Pro subscribers receive monthly API credits).
3. **Generate an API key**: In [https://www.perplexity.ai/account/api/keys](https://www.perplexity.ai/account/api/keys), click 'Generate' and copy the key. Add it to your .env file as PERPLEXITY\_API\_KEY=pplx-...
4. **Verify access**: Run the Search Web tool with a simple query. A 401 means the key is invalid; a 402 means you are out of credits.

* Sonar chat completions and agent responses are billed per token plus per-request search fees - they cost money on every call
* The Search API is billed per request and returns ranked results without LLM generation

Provider API reference: [https://docs.perplexity.ai](https://docs.perplexity.ai)

## Tools

| Tool                   | Access | Description                                                                             |
| ---------------------- | ------ | --------------------------------------------------------------------------------------- |
| Search Web             | Read   | Search the web with Perplexity's Search API and get ranked results                      |
| Create Chat Completion | Write  | Generate a web-grounded chat completion with citations using a Sonar model              |
| Create Agent Response  | Write  | Generate a response with Perplexity's Agent API using optional web search and reasoning |

## Example prompts

* Use Perplexity to research a topic I provide and summarize the answer with its citations.
* Search the web with Perplexity for a query I provide and list the top results.
