# Perplexity AI — how to use (mcp.ai)

Connect your Perplexity AI account and use 9 tools for artificial intelligence straight from your AI agent. Connect with your own API key. Perplexity AI provides conversational AI models for generating human-like text responses.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_perplexityai?ms=1787293440000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `perplexityai_create_async_chat_completion`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/perplexityai`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/perplexityai/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/perplexityai/create/async/chat/completion` — Create Async Chat Completion (POST /v1/async/sonar). Submits an asynchronous chat completion request for long-running tasks. Returns immediately with a request ID that can be polled using the Get Asyn
  - body: { request: object, idempotency_key?: string }
- `POST https://api.mcp.ai/api/perplexityai/create/chat/completion` — Perplexity Sonar Chat Completions (POST /v1/sonar). Generates web-grounded conversational AI responses with citations. Supports multiple Sonar models optimized for different use cases: - sonar: Fast, 
  - body: { stop?: string|string[], model?: string, top_p?: number, stream?: boolean, messages: object[], max_tokens?: integer, search_mode?: string, stream_mode?: string, temperature?: number, return_images?: boolean, disable_search?: boolean, response_format?: object, reasoning_effort?: string, web_search_options?: object, image_domain_filter?: string[], image_format_filter?: string[], language_preference?: string, search_domain_filter?: string[], search_recency_filter?: string, search_language_filter?: string[], enable_search_classifier?: boolean, return_related_questions?: boolean, search_after_date_filter?: string, last_updated_after_filter?: string, search_before_date_filter?: string, last_updated_before_filter?: string }
- `POST https://api.mcp.ai/api/perplexityai/create/contextualized/embeddings` — Create Contextualized Embeddings (POST /v1/contextualizedembeddings). Generates document-aware embeddings where chunks from the same document share context. Unlike standard embeddings, these recognize
  - body: { input: string[][], model: string, dimensions?: integer, encoding_format?: string }
- `POST https://api.mcp.ai/api/perplexityai/create/embeddings` — Generate vector embeddings for independent texts (queries, sentences, documents). This action takes one or more input texts and generates vector embeddings using Perplexity AI's embedding models. Embe
  - body: { input: string|string[], model: string, dimensions?: integer, encoding_format?: string }
- `POST https://api.mcp.ai/api/perplexityai/execute/agent` — Create Agent Response (POST /v1/agent). Orchestrates multi-step agentic workflows with built-in tools (web search, URL fetching, function calling), reasoning, and multi-model support. Streaming is not
  - body: { input: string, model?: string, tools?: object[], models?: string[], preset?: string, max_steps?: integer, reasoning?: object, instructions?: string, response_format?: object, max_output_tokens?: integer, language_preference?: string }
- `POST https://api.mcp.ai/api/perplexityai/get/async/chat/completion` — Get Async Chat Completion (GET /v1/async/sonar/{id}). Retrieves the result of an asynchronous chat completion request by its ID. Use this to poll for the result after creating an async job. The respon
  - body: { request_id: string }
- `POST https://api.mcp.ai/api/perplexityai/list/async/chat/completions` — List Async Chat Completions (GET /v1/async/sonar). Retrieves a list of all asynchronous chat completion requests for the authenticated user. Use this to see the status of all your pending, completed, 
- `POST https://api.mcp.ai/api/perplexityai/list/models` — List Models (GET /v1/models). Lists models available for the Agent API. Returns model identifiers that can be used with the Agent endpoint. The response follows the OpenAI List Models format for compa
- `POST https://api.mcp.ai/api/perplexityai/search` — Search the Web (POST /search). Returns raw, ranked web search results directly from Perplexity's index without LLM processing. Faster and cheaper than chat completions when you need raw results. Suppo
  - body: { query: string|string[], country?: string, max_tokens?: integer, max_results?: integer, max_tokens_per_page?: integer, search_domain_filter?: string[], search_recency_filter?: string, search_language_filter?: string[], search_after_date_filter?: string, last_updated_after_filter?: string, search_before_date_filter?: string, last_updated_before_filter?: string }

## Example prompts
- "What can I do in Perplexity AI?"
- "Show me a summary of my Perplexity AI account"

## More
- Page: https://mcp.ai/perplexityai
- Agent spec (llms.txt): https://mcp.ai/perplexityai/llms.txt
- Postman collection: https://mcp.ai/perplexityai/postman.json
