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

# Perplexity Plugin

> Web search powered by Perplexity Sonar — AI-synthesized answers with citations from live web data.

**Plugin ID:** `perplexity` | **Auth:** API Key (Bearer token)

## Tools

### perplexity.search

**Name:** Web Search

Search the web using Perplexity Sonar and get an AI-synthesized answer with citations. Use for current events, research, fact-checking, or any question that benefits from live web data.

**Input:**

| Parameter                  | Type       | Required | Default    | Description                                                                   |
| -------------------------- | ---------- | -------- | ---------- | ----------------------------------------------------------------------------- |
| `query`                    | `string`   | Yes      | --         | The search query or question                                                  |
| `model`                    | `string`   | No       | `"sonar"`  | `"sonar"`, `"sonar-pro"`, `"sonar-reasoning-pro"`, or `"sonar-deep-research"` |
| `system_prompt`            | `string`   | No       | --         | System prompt to guide response style                                         |
| `search_domain_filter`     | `string[]` | No       | --         | Domains to include/exclude (prefix with `-` to exclude)                       |
| `search_recency_filter`    | `string`   | No       | --         | `"hour"`, `"day"`, `"week"`, or `"month"`                                     |
| `search_context_size`      | `string`   | No       | `"medium"` | `"low"`, `"medium"`, or `"high"`                                              |
| `return_related_questions` | `boolean`  | No       | `false`    | Return follow-up question suggestions                                         |
| `max_tokens`               | `integer`  | No       | --         | Max output tokens                                                             |

**Output:**

```json theme={null}
{
  "answer": "According to recent reports [1], the market has...",
  "citations": ["https://example.com/article1", "https://example.com/article2"],
  "search_results": [
    { "title": "Market Report 2026", "url": "https://example.com/article1", "snippet": "The market grew by..." }
  ],
  "related_questions": ["What are the key drivers?"],
  "model": "sonar",
  "usage": { "prompt_tokens": 50, "completion_tokens": 200, "total_tokens": 250 }
}
```

***

### perplexity.chat

**Name:** Web Search Chat

Multi-turn chat with Perplexity Sonar. Provide conversation history for follow-up questions that maintain context from previous search results.

**Input:**

| Parameter               | Type       | Required | Default    | Description                                        |
| ----------------------- | ---------- | -------- | ---------- | -------------------------------------------------- |
| `messages`              | `array`    | Yes      | --         | Conversation history (`{ role, content }` objects) |
| `model`                 | `string`   | No       | `"sonar"`  | Model to use                                       |
| `search_domain_filter`  | `string[]` | No       | --         | Domain filters                                     |
| `search_recency_filter` | `string`   | No       | --         | Recency filter                                     |
| `search_context_size`   | `string`   | No       | `"medium"` | Context size                                       |
| `max_tokens`            | `integer`  | No       | --         | Max output tokens                                  |

**Output:**

```json theme={null}
{
  "answer": "Building on the previous search...",
  "citations": ["https://example.com/follow-up"],
  "search_results": [{ "title": "...", "url": "...", "snippet": "..." }],
  "model": "sonar",
  "usage": { "prompt_tokens": 150, "completion_tokens": 300, "total_tokens": 450 }
}
```
