Perplexity
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.
import "github.com/xraph/nexus/providers/perplexity"
provider := perplexity.New(os.Getenv("PERPLEXITY_API_KEY"))
gw := nexus.New(
nexus.WithProvider(provider),
)
| Option | Description |
|---|
perplexity.WithBaseURL(url) | Override the API base URL (default: https://api.perplexity.ai) |
| Capability | Supported |
|---|
| Chat | Yes |
| Streaming | Yes |
| Embeddings | No |
| Vision | No |
| Tools | No |
| Thinking | No |
| 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 |