Perplexity AI REST API
Conversational AI search with real-time web citations
Perplexity AI is a conversational search engine API that provides AI-powered answers with real-time web citations and sources. Developers integrate Perplexity to build applications that require up-to-date information, fact-checked responses, and transparent source attribution. The API supports streaming responses, multiple AI models, and custom search domains for specialized use cases.
https://api.perplexity.ai
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /chat/completions | Generate AI responses with web search integration and citations |
| POST | /chat/completions/stream | Stream AI responses in real-time with progressive citations |
| GET | /models | List available AI models including sonar, codellama, and mixtral variants |
| POST | /search | Perform direct web search with AI-powered result summarization |
| POST | /search/focus | Execute focused searches on specific domains like academic, news, or reddit |
| GET | /usage | Retrieve API usage statistics and token consumption data |
| POST | /citations/verify | Verify and validate citation accuracy for generated responses |
| GET | /models/{model_id} | Get detailed information about a specific AI model |
| POST | /search/domains | Configure custom domain restrictions for search results |
| GET | /account/limits | Check current rate limits and quota availability |
| POST | /embeddings | Generate vector embeddings for text using Perplexity models |
| DELETE | /cache/{cache_id} | Clear cached search results and responses |
| POST | /collections | Create collections of related searches for context continuity |
| GET | /collections/{collection_id}/history | Retrieve conversation history from a specific collection |
Sponsor this page
AvailableReach developers actively building with Perplexity AI. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl -X POST https://api.perplexity.ai/chat/completions \
-H "Authorization: Bearer pplx-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "sonar-small-chat",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What are the latest developments in quantum computing?"
}
],
"max_tokens": 500,
"temperature": 0.7,
"return_citations": true
}'
Use Perplexity AI from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for Perplexity AI. Paste your Perplexity AI API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Perplexity AI directly with your credentials — no local install, works on mobile.
perplexity_search
Search the web with AI-powered summarization and get cited answers to queries in real-time
perplexity_focused_search
Perform domain-specific searches (academic, news, reddit, youtube) with contextual AI responses
perplexity_verify_citations
Validate the accuracy and relevance of citations in AI-generated responses
perplexity_stream_response
Generate streaming AI responses for real-time conversational interfaces with progressive citations
perplexity_create_collection
Create and manage conversation collections for maintaining context across multiple queries
Connect in 60 seconds
Paste your Perplexity AI key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect Perplexity AI to your AI →