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.