---
title: Perplexity
description: Use Perplexity's search-augmented generation models with Nexus.
---

Perplexity provides search-augmented generation models that combine LLM capabilities with real-time web search. Uses an OpenAI-compatible API.

## Installation

```go
import "github.com/xraph/nexus/providers/perplexity"
```

## Quick Start

```go
provider := perplexity.New(os.Getenv("PERPLEXITY_API_KEY"))

gw := nexus.New(
    nexus.WithProvider(provider),
)
```

## Options

| Option | Description |
|--------|-------------|
| `perplexity.WithBaseURL(url)` | Override the API base URL (default: `https://api.perplexity.ai`) |

## Capabilities

| Capability | Supported |
|-----------|-----------|
| Chat | Yes |
| Streaming | Yes |
| Embeddings | No |
| Vision | No |
| Tools | No |
| Thinking | No |

## Models

| Model | Context | Max Output | Input Price | Output Price |
|-------|---------|-----------|-------------|-------------|
| `sonar-pro` | 127K | 4,096 | $3.00/M | $15.00/M |
| `sonar` | 127K | 4,096 | $1.00/M | $1.00/M |
| `sonar-reasoning` | 127K | 4,096 | $1.00/M | $5.00/M |
