Skip to main content

Overview

Perplexity provides AI models with built-in web search capabilities, delivering up-to-date information and citations. Access Perplexity’s Sonar models through Portkey for search-augmented AI responses. Base URL: https://api.perplexity.ai

Supported Features

  • ✅ Chat Completions
  • ✅ Streaming
  • ✅ Web Search Integration
  • ✅ Citations
  • ✅ Real-time Information
  • ❌ Embeddings
  • ❌ Function Calling
  • ❌ Vision
  • ❌ Image Generation

Quick Start

Streaming

Available Models

Sonar Models (Online)

These models have access to the web and provide citations:

Chat Models (Offline)

Standard chat models without web access:
Perplexity excels at:
  • Real-time information - Access current web data
  • Fact-checking - Verify information with citations
  • Research - Comprehensive web search
  • Current events - Up-to-date news and developments
  • Citation tracking - Source attribution

Configuration Options

Advanced Features

System Messages

Temperature Control

Multi-turn Conversations

Use Cases

Research & Analysis

Current Events

Fact Verification

Fallback Configuration

Fallback to GPT-4 for non-search queries:

Conditional Routing

Route to Perplexity for search queries, GPT-4 for others:

Error Handling

Best Practices

  1. Use for current information - Leverage web search capabilities
  2. Lower temperature - For factual accuracy (0.0-0.3)
  3. Clear queries - Specific questions get better results
  4. Request citations - Ask model to cite sources
  5. Use sonar-pro - For important research
  6. Use sonar - For quick lookups
  7. Verify information - Always validate critical facts
  8. Implement caching - Cache responses to reduce costs

Limitations

  • No function calling support (yet)
  • No vision capabilities
  • No embeddings
  • Search results depend on web availability
  • May have slightly higher latency due to search

When to Use Perplexity

Use Perplexity when:
  • You need current, real-time information
  • Research requires web search
  • Citations and sources are important
  • Fact-checking is critical
  • Questions involve recent events
Use other providers when:
  • Information is static or historical
  • You need vision or function calling
  • Lower latency is critical
  • You’re doing creative writing

Pricing

Perplexity Pricing

View detailed pricing for Perplexity models

Conditional Routing

Route based on search needs

Fallbacks

Fallback configurations

Caching

Cache search results

Google Gemini

Alternative with search