P

Perplexity AI API

by Perplexity AI

Perplexity AI's API provides access to its search-augmented language models. Unlike standard LLMs, Perplexity models fetch current web data to ground responses with citations, making them ideal for research, news summarization, and fact-checking workflows. Supports both online models (with live search) and offline models (standard generation). OpenAI-compatible API format.

searchonlinecitationsreal-timeresearchllm

Quick Reference

Base URL https://api.perplexity.ai Auth type Bearer Token Auth header Authorization: Bearer pplx-... Rate limit 50 requests/min Pricing from $0.20/mo Free quota $5 free credits for new accounts Documentation https://docs.perplexity.ai Endpoint status Server online — HTTP 404 — server is online but path returned an error (may require auth)564ms (checked Mar 29, 2026) Builder score C 55% builder-friendly
Pricing
75
Latency
38
Depth
52

Authentication

Generate an API key in Perplexity Settings → API. Pass it as a Bearer token in the Authorization header.

Authorization: Bearer pplx-...

Pricing

Model pay-as-you-go Starting price from $0.20/mo Free quota $5 free credits for new accounts

Sonar (online): $1 per 1M input tokens + $5 per 1,000 search queries. Sonar Pro: $3/M input + $5/1k searches. Offline models from $0.20/M tokens.

Key Endpoints

MethodPathDescription
POST /chat/completions Chat completions with optional web search grounding

Sample Request

curl "https://api.perplexity.ai/chat/completions" \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"sonar","messages":[{"role":"user","content":"What are the latest AI model releases in 2026?"}]}'

Sample Response

{
  "id": "gen-abc123",
  "model": "sonar",
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "In 2026, notable AI releases include... [1][2]"
    }
  }],
  "citations": ["https://techcrunch.com/...", "https://theverge.com/..."]
}

Data sourced from API Map. Always verify pricing and rate limits against the official Perplexity AI documentation.