Developers must prepare for the scheduled deprecation of Sonar, Sonar Pro, and Sonar Reasoning Pro on September 27, 2026, to ensure their enterprise search agents continue to function without interruption. Perplexity provides an official migration guide to assist with this transition. The current Sonar models provide real-time web access and structured outputs, but they will no longer be supported after this date. The newer Agent API serves as the primary replacement, providing access to a wider range of models and more advanced tool-use capabilities.
The Sonar model family includes four distinct tiers designed for different levels of complexity. Sonar is a lightweight model for simple information retrieval and quick factual queries. Sonar Pro handles complex, multi-step queries that require deeper understanding and context retention. Sonar Reasoning Pro is a premium model for analytical tasks that require step-by-step thinking. Sonar Deep Research is an expert model for producing long-form, source-dense reports through exhaustive multi-step searches.
| Model | Input Cost (per 1M tokens) | Output Cost (per 1M tokens) | Context Window | Max Output Tokens |
|---|---|---|---|---|
| Sonar | $1.00 | $1.00 | 128,000 | 4,096 |
| Sonar Pro | $3.00 | $15.00 | 200,000 | 8,192 |
| Sonar Reasoning Pro | $2.00 | $8.00 | 128,000 | 4,096 |
| Sonar Deep Research | $2.00 | $8.00 | 128,000 | 115,200 |
Model capabilities and task suitability
The Sonar Pro model provides a 200,000 token context window. It handles multi-step reasoning. It performs multiple web searches. It generates high-accuracy outputs. It delivers citations for every response. This model excels at agentic web search because it plans and refines queries to answer complex questions grounded in live online data. It also manages long-context analysis by handling large inputs for the analysis of lengthy documents or multi-part queries.
Developers use Sonar Pro for specific workloads such as cited research answers and document-like content extraction. The model extracts key facts and compares information from web pages or articles. It also supports multilingual question answering while grounding responses in external information. For developers building applications, the Sonar models support structured outputs via JSON Schema. This allows for the integration of AI responses into automated workflows.
Certain tasks are better suited for specific models. The Sonar model is the most cost-effective option for straightforward queries. Sonar Pro is the choice for complex queries that need multi-step reasoning and broader web context. Sonar Reasoning Pro is for analytical tasks requiring step-by-step Chain of Thought reasoning. Sonar Deep Research is for comprehensive reports that require exhaustive web searches across many sources.
| Model Use Case | Recommended Model |
|---|---|
| Quick factual lookups | Sonar |
| Multi-step reasoning | Sonar Pro |
| Structured analysis | Sonar Reasoning Pro |
| Long-form research | Sonar Deep Research |
The two-layer cost structure of the Sonar API
Perplexity charges for two separate components: token volume and request fees. Token pricing follows standard LLM logic where input and output costs vary by model. However, the per-request fee depends on the search context size. For the base Sonar model, low context costs $5 per 1,000 requests, medium context costs $8 per 1,000 requests, and high context costs $12 per 1,000 requests. Sonar Pro and Sonar Reasoning Pro request fees range from $6 for low context to $14 for high context.
The per-request fee is often the largest part of the bill. On base Sonar, the search fee can account for 88% to 94% of the total cost of a query. For a short query with 300 input tokens and 400 output tokens, the token cost is minimal compared to the fixed search fee. The Sonar Pro tier reduces the relative impact of the fee because its output tokens cost $15 per million, which is 15 times the base Sonar rate.
Scale changes the math significantly for production applications. At 50,000 queries per day, routing all traffic through Sonar Pro at high context instead of Sonar at low context costs $1,500 per day versus $300 per day. This difference results in $36,000 of avoidable spend every month. For a query with 600 input tokens and 400 output tokens, the total cost includes the token costs plus the additional request-level charges.
| Model Tier | Low Context Fee | Med Context Fee | High Context Fee |
|---|---|---|---|
| Sonar | $5 / 1,000 | $8 / 1,000 | $12 / 1,000 |
| Sonar Pro | $6 / 1,000 | $10 / 1,000 | $14 / 1,000 |
| Sonar Reasoning Pro | $6 / 1,000 | $10 / 1,000 | $14 / 1,000 |
Sonar Deep Research specific pricing mechanics
Sonar Deep Research operates under a different cost model than the standard Sonar tiers. It does not use the low, medium, or high context fee structure. Instead, costs scale with the number of autonomous searches the model performs. It charges $2 per million citation tokens and $3 per million reasoning tokens. Additionally, it charges $5 per 1,000 search queries.
A single Deep Research query can cost anywhere from $0.30 to over $1.30. This total depends on the depth of the context and the number of searches the model decides to run. The reasoning tokens often represent the biggest cost driver because the model must think, search, and synthesize. Because the model decides how many searches to run, the costs are less predictable than standard models.
For developers, Deep Research is an expert research model rather than a high-volume lookup tool. It supports asynchronous jobs and includes a reasoning effort parameter to control the depth of analysis. You should not use Deep Research for ultra-low-cost, high-volume inference where web search overhead is unnecessary.
Implementation and authentication protocols
The Perplexity API is compatible with the OpenAI client library. This means developers can use the OpenAI Python SDK by changing the base URL to https://api.perplexity.ai. Integration is straightforward because the API follows the same request shape as OpenAI. Authentication uses Bearer token credentials in the Authorization header.
Developers must manage their API keys with security in mind. You should never expose your key in client-side code or public repositories. Store the key in environment variables or a secure vault. For Python implementations, use the os module to load the key from an environment variable.
A minimal request involves the chat completions endpoint at https://api.perplexity.ai/v1/chat/completions. The request must include the model name and a messages array. The response includes a choices array containing the assistant text and a citations array containing URLs to the web sources. You can verify a valid key by running a cURL command against the models endpoint. If the server returns a 401 error, the key is invalid or improperly set.
Controlling search behavior through parameters
The Sonar API provides parameters to control how the underlying search functions. The search_domain_filter allows you to restrict searches to specific domains. This is useful for compliance or technical use cases where you only trust certain sources. The search_recency_filter lets you set the age of the information. You can use values such as hour, day, week, or month.
The search_context_size parameter controls the amount of web information the model ingests. You can select from low, medium, or high options. Higher context leads to more thorough grounding but increases the per-request fee. You should use the low setting for simple factual lookups to keep costs down.
The API also provides options for the output format. You can use the response_format parameter with JSON Schema to receive machine-parseable responses. The return_related_questions parameter returns suggested follow-up queries. The return_images parameter includes relevant images in the response. Do not ask the model to embed URLs inside a JSON response, as this is unreliable. Use the citations field in the response metadata for verifiable URLs.
Advanced Agentic workflows via the Agent API
The Agent API provides a higher-level interface for multi-provider workflows. It supports the use of multiple AI models and built-in tool calls. The models parameter accepts up to five models to enable automatic failover if a primary model is unavailable. This allows you to route requests to the optimal provider based on cost, latency, or quality.
The Agent API includes three presets for different workflows. The fast-search preset is for quick lookups. The pro-search preset is for thorough, multi-source queries. The deep-research preset is for exhaustive investigations that allow up to 10 research loop iterations. Tool usage in the Agent API incurs separate fees from the token costs. A web search invocation costs $0.005. A fetch URL invocation costs $0.0005.
You can monitor usage through the usage object in the API response. This object includes a cost breakdown in USD that covers input, output, cache operations, and tool invocations. The response status field tells you if the task was completed or failed. If a task fails, the error object provides the details.
Data privacy and security for enterprise users
Perplexity follows a zero-data-retention policy for its API. The company does not store prompts or completions and does not use customer data to train models. This policy is documented in Perplexity’s privacy and security documents and is backed by a SOC 2 Type II report. This is a material difference from consumer plans like Free, Pro, and Max, where training on data is enabled by default.
The API is designed for professional workloads where data privacy is required. You should minimize the amount of sensitive data in your prompts. Implement data anonymization where possible. Establish clear data retention policies for your own systems.
When using self-hosted retrieval stacks like Perplexica, the privacy model changes. In a self-hosted setup, the LLM synthesis step stays on your own infrastructure. However, the web-retrieval step still sends queries to external search engines unless you use private sources. The Sonar API sends the query to Perplexity to perform the search. Neither setup is strictly more private in every dimension.
Economic comparison of API and self-hosting
Building an enterprise search agent requires a decision between using the Sonar API or a self-hosted RAG stack. A self-hosted stack using an H100 PCIe instance and a Perplexica-style setup costs approximately $1,447 per month for 100,000 queries. This cost is close to fixed because you pay for GPU hours rather than per-call fees. You can lower the cost per query by adding semantic caching, which provides a 40% to 60% cache hit rate.
The API is cheaper for low volumes. The API becomes more expensive as volume increases. For the Sonar Pro tier, the crossover point where self-hosting becomes more economical is between 69,000 and 86,000 queries per month. This calculation depends on the specific model tier and context size you use.
The Sonar API is a poor choice for workloads requiring millisecond-level latency where multiple web retrieval hops are unacceptable. It is also not suitable for processing sensitive PII or trade secrets that cannot leave your environment. You should not use the API for tasks requiring fine-tuning or custom training of base model weights. Can the Agent API handle specialized medical queries without violating strict domain constraints?
Use the Sonar API if you need a managed service with real-time web grounding and built-in citations. Use a self-hosted stack if you need to run an air-gapped model or if your query volume exceeds 100,000 requests per month and justifies the cost of an H100 instance.




