Perplexity AI
Listed at https://docs.perplexity.ai
💰 Token Pricing
| Type | Price | Note |
|---|---|---|
| Input | Sonar Pro: $3/M, Sonar: $1/M | per million tokens |
| Output | Sonar Pro: $15/M, Sonar: $1/M | per million tokens |
🤖 Supported Models (3)
✨ Pros
- ✓Sonar Pro with built-in web search, responses cite sources
- ✓Clean API, mirrors web experience 1:1
- ✓Fast response (Sonar ~300ms first token)
- ✓Search result quality better than GPT-4o online
- ✓Custom search_domain_limit parameter
⚠️ Cons
- ×No Function Calling support
- ×Model not selectable (underlying model fixed)
- ×No free API tier, pricing not low
- ×Proxy required in China
- ×Search-only, not for general chat
🎯 Best For
Search-enhanced Q&A apps; citation-reliable content generation; research assistance tools
💰 Pricing & Plans
| Plan | Price | Best For | Limits |
|---|---|---|---|
| Sonar (pay-as-you-go) | $1/M input + $1/M output + $5/1k search queries | Lightweight Q&A, low-volume search | Cheapest tier; no monthly minimum |
| Sonar Pro (pay-as-you-go) | $3/M input + $15/M output + $5/1k search queries | Pro-grade reasoning + multi-source citation | Search-grounded reasoning at 2× context |
| Perplexity Pro subscription | $20/month (or $200/year) | End-user web/app, 500 Pro searches/day | Not an API plan — consumer-facing only |
| Enterprise (custom) | Negotiated volume contracts | High-volume RAG over proprietary corpora | SLA + custom search domain allowlist |
| Citation surcharge | $5 per 1,000 citation queries (Sonar/Sonar Pro) | Cost of the search index call | Stacked on top of token pricing |
🔧 API & Developer Experience
- •API Style: OpenAI-compatible /chat/completions endpoint with extra search-domain and recency parameters; identical SDK shape to OpenAI clients.
- •Base URL: https://api.perplexity.ai — single global endpoint, no region pinning.
- •SDK Compatibility: Drop-in for any OpenAI SDK by overriding base_url; no separate Perplexity SDK required. Official Node/Python snippets published in docs.
- •Citation Return: Each response includes a `citations` array with source URLs and snippet text — passable straight to a UI renderer without scraping.
- •Search Domain Filter: `search_domain_filter` (allowlist of domains) and `search_recency_filter` (hour/day/week/month) constrain the index query — useful for compliance-sensitive verticals.
- •Streaming: SSE token streaming; citations arrive with the final chunk, not interleaved — UI must buffer or animate-in after completion.
- •Tool / Function Calling: NOT supported as of 2026-08 — Perplexity routes search through its own indexer rather than user-supplied function calls. Workaround: prepend tool definitions to the system prompt.
🌐 Citation-Grounded Web Search
Citation-grounded web search is the one capability that defines Perplexity relative to every other LLM API in 2026. Each Sonar/Sonar Pro response returns a structured `citations` array containing source URLs plus the exact snippet that grounded each claim — meaning a downstream UI can render inline footnotes, source lists, or hover-cards without any extra scraping step. The `search_domain_filter` parameter constrains the indexer to an allowlist of domains (useful for compliance, journalism, or finance), and `search_recency_filter` enforces a freshness window (hour / day / week / month). Citation cost is itemized separately at $5 per 1,000 citation queries, stacked on top of token pricing — a Sonar Pro call that returns 5 citations effectively pays for both the inference and the search-index access. The trade-off versus running your own retrieval pipeline is obvious: zero infrastructure to maintain, no crawler lag, no index staleness — but the citation surface is whatever Perplexity's index has indexed, which lags real-time events by 5-30 minutes.
🌏 Regional Availability & Latency
Perplexity's API (api.perplexity.ai) is not directly reachable from mainland China — the generative endpoint and citation query both require stable proxy or VPN. For developers in Beijing / Shanghai / Shenzhen, the typical workaround is one of: (1) route through a US-region VPS that already proxies other LLM APIs, (2) use an aggregator (OpenRouter, Portkey) that ships a CN edge node and signs the upstream contract on your behalf, or (3) subscribe to the consumer Pro tier via the international App Store, then mirror the web experience without touching the API. From non-CN regions, latency is consistent — Sonar typically returns the first token in ~300 ms because the citation query is fired in parallel with the LLM warm-up. For high-frequency citation-heavy workloads (news monitoring, RAG), the per-call overhead is dominated by the $5/1k citation surcharge rather than the network hop, so cost engineering should focus on citation count first, latency second.