canonical: https://jentic.com/apis/perplexity.ai/perplexity

# Perplexity API

Perplexity AI is a search-enhanced large language model API that combines real-time web search with LLM generation. The API provides a chat completions endpoint compatible with OpenAI's format, allowing developers to build applications that leverage both search and generation capabilities. Perplexity models can search the web for current information and synthesize results into coherent responses, making them ideal for knowledge-intensive tasks that require up-to-date information.

## For AI agents

Generate search-enhanced LLM responses using Perplexity AI models with real-time web search capabilities.

## Scope

Provides access to perplexity.ai resources and operations as documented in the OpenAPI specification.

## Capabilities

- Generate chat completions with real-time web search integration
- Access multiple Perplexity models including sonar-small, sonar-medium, and sonar-pro
- Stream responses for real-time user experiences
- Retrieve search citations and sources alongside generated content
- Use OpenAI-compatible API format for easy integration

## Use cases

### Search-Enhanced Q&A

Build question-answering systems that combine LLM reasoning with real-time web search. The chat completions endpoint searches the web for relevant information and generates comprehensive responses with citations. Ideal for customer support, research assistants, and knowledge base systems that need current information.

Example prompt: POST `/chat/completions` with a user question to generate a search-enhanced response with citations and sources from the web.

### Real-Time Research Assistant

Create AI assistants that can research topics using current web information. Perplexity searches across multiple sources, synthesizes findings, and provides citations. Use streaming for progressive response delivery as the model searches and generates.

Example prompt: POST `/chat/completions` with stream=true to get progressive search results and generation as the model researches the topic.

### AI Agent with Search Tools

Integrate Perplexity as a search-enhanced reasoning tool for AI agents built with frameworks like LangChain or custom agent systems. Through Jentic, the agent can discover and invoke the Perplexity API when tasks require current web information, without hardcoding the integration.

Example prompt: Search Jentic for 'perplexity search' to find POST `/chat/completions`, load its schema, and execute when the agent needs current web information.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/chat/completions` | Generate search-enhanced chat completions with citations |

## Key resources

- **Chat Completions** — OpenAI-compatible chat completions endpoint with integrated web search
- **Models** — sonar-small, sonar-medium, sonar-pro with varying capabilities and cost
- **Citations** — Source URLs and snippets returned alongside generated responses

## Why Jentic

- **Setup:** Wiring the Perplexity API by hand means setting up its bearer token auth against api.perplexity.ai and handling request formatting and retries for the chat completions endpoint yourself. Through Jentic you install once, import the Perplexity API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** The Perplexity API exposes a single POST `/chat/completions` operation, so the honest control is operations-only: you limit the agent to just the completion call it needs, and no other operation is reachable because none is exposed.
- **Credential handling:** Your Perplexity token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'answer a question with cited web results', and Jentic returns the matching Perplexity chat completions operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## FAQ

### What authentication does the Perplexity API use?

The Perplexity API uses bearer authentication. Through Jentic, credentials are stored encrypted and injected at execution time so they never enter the agent's context.

### How many endpoints does the Perplexity API have?

The Perplexity API exposes 1 endpoints across its surface area.

### Can I limit what my agent is allowed to do with the Perplexity API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use. The Perplexity API exposes a single POST `/chat/completions` operation, so you can scope the agent to just that search-enhanced completion call and nothing else is reachable, since no other operation is exposed. Your Perplexity bearer token is stored encrypted by your own instance and injected only at execution time, so the agent can invoke the endpoint without ever seeing the credential.
