Skip to main content
While Sonar Chat Completions remains supported, 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 presets.
We recommend:
  • Migrating existing Sonar Chat Completions usage to the Agent API.
  • Using the Agent API for all new projects.

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 — presets).
  • 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.
  • Wide Research to run wide-and-deep tasks in the background and build large, evidence-backed collections in a single request.

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 presets

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 preset mappings.
For state-of-the-art deep research, use the xhigh preset — the highest quality in the lineup, leading across the benchmarks we run.
See Choosing a preset for what each preset is best for.

Continue your migration

How to migrate

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

Explore the presets

See what each preset configures and how to override individual settings.