Perplexity API
Perplexity API
Perplexity API provides web-connected LLM — automatically searches the web when answering, avoiding LLM knowledge cutoff issues.
Auto web connectivity (no manual Google API + RAG implementation)
No custom retrieval (Perplexity decides what to search)
Apply for API access at docs.perplexity.ai for key. POST https://api.perplexity.ai/chat/completions with model: "llama-3.1-sonar-large-128k-online" + messages.
Uptime · 30-day window
About this API
Perplexity is an AI search engine company founded 2022, focused on "conversational web search" — unlike traditional Google giving a pile of links, Perplexity directly answers questions with citations. Technically an engineered integration of LLM + web search: user asks question → Perplexity auto-queries Bing/Google → top results fed to LLM → LLM generates answer with citations. This design naturally solves LLM's two big problems: knowledge cutoff ("I don't know post-2024") and hallucination (citations let users verify). The API lets developers integrate this web-connected LLM into their apps — AI assistants answering "what happened today", research tools auto-searching latest literature, customer service answering policy-related questions. Sonar series is its LLM (fine-tuned from Llama); online-suffix models auto-connect to web, offline models don't.
What you can build
- 1Real-time news Q&A
- 2Research assistants (auto-search latest literature)
- 3AI agents needing current info
- 4Customer service answering latest product / policy questions
Strengths & limitations
Strengths
- Auto web connectivity (no manual Google API + RAG implementation)
- Answers include citation links
- OpenAI-compatible API
Limitations
- No custom retrieval (Perplexity decides what to search)
- Slightly higher than pure LLM pricing
- Tighter rate limits
Example request
curl https://www.perplexity.ai/<endpoint> \
-H "Authorization: Bearer $API_KEY"
# Some providers use X-Api-Key instead — verify in the docs.Getting started
Apply for API access at docs.perplexity.ai for key. POST https://api.perplexity.ai/chat/completions with model: "llama-3.1-sonar-large-128k-online" + messages.
FAQ
Can I control which sources are searched?+
API supports search_domain_filter parameter to allow/exclude specific domains, but internal search algorithm is not exposed.
Perplexity vs. OpenAI + custom RAG?+
Perplexity: zero-ops but black box. Custom RAG: controllable but engineering-heavy. Choose based on how hands-on you want to be.
Technical details
- Auth type
- api_key
- Pricing
- paid
- Rate limit
- 默认 50 calls/分;可申请提高
- Protocols
- REST
- SDKs
- python, typescript
- Response time
- 77 ms
- Last health check
- 5/12/2026, 7:38:04 AM