Skip to main content
The Agent API is more performant and cost-effective for production workloads. It features Perplexity’s latest innovations in search and reasoning technology, including Search as Code and tuned effort levels.
We recommend:
  • Migrating existing Sonar Chat Completions usage to the Agent API.
  • Using the Agent API for all new projects.
Sonar Chat Completions support ended on September 27, 2026. Synchronous and streaming requests keep working: they are being reformulated as Agent API requests, rolling out gradually by model. Asynchronous Sonar requests are not reformulated and are no longer supported; move them to background mode.

About the Agent API

Agent API is a unified interface for building powerful agent applications. It contains:
  • One API to call all the leading frontier and open-source models.
  • Built-in tools such as web search, URL fetching, sandboxes, and MCP, plus premium data sources like finance and people search.
  • Research-backed configurations for agentic workflows, based on specific task intensity (fast, low, medium, high, xhigh — effort levels).
  • Compatibility with the Open Responses standard to ensure portability and avoid lock-in — we want to win your business on performance and efficiency, not on locking you in with exorbitant migration costs.
  • Seamless multi-turn interactions that let you pass previous responses for higher-accuracy reasoning.

Why migrate

Agent API contains several benefits over Sonar Chat Completions:
  • Full flexibility to select across the OpenAI, Anthropic, Google, xAI, Z.AI, Moonshot AI, and NVIDIA model families, in addition to Perplexity’s Sonar model.
  • The ability to leverage multiple tools and spin up an agentic loop that reasons, acts, observes results, and continues within a single request.
  • A secure sandbox to run generated code — compute results, analyze data, and verify outputs without leaving the request.
  • Connect external servers with MCP or define your own custom functions to extend the agent with your tools and private data.

Sonar vs Agent API

Both call a model but shape the request differently. Sonar takes a messages array and returns choices. The Agent API takes an input and returns a typed output array — one item per step the model took, with a message item for the answer text and a search_results item for the sources.
Sonar
Agent API

How Sonar Chat Completions maps to Agent API effort levels

While performance improvements will vary by individual use-case, our internal benchmarks indicate performance improvements across the below comparable Sonar Chat Completions and Agent API effort level mappings.
For state-of-the-art deep research, use the xhigh effort level — the highest quality in the lineup, leading across the benchmarks we run.
See Choosing an effort level for what each effort level is best for, and the benchmarks page for the scores.

Continue your migration

How to migrate

Follow the complete field-by-field migration procedure and parameter reference.

Explore the effort levels

See what each effort level configures and how to override individual settings.