Perplexity Sonar API logo

Perplexity Sonar API

Perplexity Sonar API is the developer platform behind Perplexity's real-time web research, exposed as a Router API, an Agent API, a Search API and an Embeddings API.

The Router API gives OpenAI-compatible access to open-weight models hosted by Perplexity, the Agent API returns web-grounded answers with built-in citations in one call, and the Search API returns raw ranked web results…

Perplexity Sonar API screenshot

Perplexity Sonar API is the developer platform behind Perplexity's real-time web research, exposed as a Router API, an Agent API, a Search API and an Embeddings API. The Router API gives OpenAI-compatible access to open-weight models hosted by Perplexity, the Agent API returns web-grounded answers with built-in citations in one call, and the Search API returns raw ranked web results with filtering. Billing is usage-based: tokens are charged at each model's published rate, and tools such as web_search cost $0.0025 per invocation, fetch_url $0.0005 and sandbox sessions $0.03.

This API is aimed at software engineers and product teams who need current web knowledge inside their own applications: startups adding answer engines to a product, data and machine learning engineers building retrieval pipelines, and enterprise teams creating research assistants. Developers who already call an OpenAI-style endpoint can switch the Router API in with little change, while teams that want raw results and full control over ranking can choose the Search API. Familiarity with API keys, SDKs and token-based billing is expected.

Common builds include customer-facing question answering with cited sources, market and competitor research agents that fetch and read pages, financial assistants using the finance_search tool, and recruiting or sales tools that use people_search. The Embeddings API supports semantic search and retrieval-augmented generation over private content, and the Agent API can route requests to models from OpenAI, Anthropic, Google, xAI and other providers while attaching web search tools. A sandbox tool lets an agent run code in an isolated container during a request, which suits data analysis steps inside an agent loop.

Perplexity Sonar API alternatives

See all →

Frequently asked

6 questions
What does the Search API return?
It returns raw, ranked web search results with advanced filtering and real-time data. Developers use it when they want to control how results are processed rather than receive a finished answer.
Who should use Perplexity Sonar API?
Developers and product teams embedding real-time research and question answering into their own applications are the target audience. It also fits teams building retrieval pipelines with the Embeddings API.
What can I build with the Agent API?
The Agent API gives web-grounded answers with built-in citations in a single call. It also reaches third-party models from OpenAI, Anthropic, Google, xAI, Z.AI, Moonshot AI and NVIDIA, with web search tools and presets.
How is Perplexity Sonar API priced?
Router API usage is billed per token at each model's published rate with no per-request fees. Agent API tools are charged per use, for example $0.0025 for a standard web search and $0.001 for a fast search.
What are the limitations of the API?
Costs depend on token and tool usage, so heavy agent workflows can add up quickly. Documentation also notes that AI-generated responses may contain mistakes, so citations should be checked.
How do I get started with Perplexity Sonar API?
Create an API key from the documentation, then call the endpoint of your choice. The Router API is OpenAI-compatible, and an official Perplexity SDK and rate-limit documentation are available.

Reviews (0)

Write review

No reviews yet. Be the first to share your experience.