Sonar Pro
Sonar Pro is Perplexity's search model with deeper web retrieval across more sources. It returns citation-rich answers for complex research queries within a context window of 200K tokens.
View API reference- Input and output price
- Input $3, Output $15, Per 1M tokens
- 24h uptime
- Loading AI Gateway uptime
import { streamText } from 'ai'
const result = streamText({ model: 'perplexity/sonar-pro', prompt: 'Why is the sky blue?'})Copy link to headingPlayground
Try out Sonar Pro by Perplexity. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Sonar Pro
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Copy link to headingUptime24 hours
Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.
Copy link to headingThroughput24 hours
P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.
Copy link to headingLatency24 hours
P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.
Getting started
Call Sonar Pro through AI Gateway with the AI SDK generateText and streamText functions, or through the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages APIs by changing the base URL. AI Gateway authenticates the request and routes it to an available provider.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the text generation quickstart.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'perplexity/sonar-pro', prompt: 'Why is the sky blue?', });
console.log(result.text);}
main().catch(console.error);Top-level parameters
The same Sonar Pro request in each API format AI Gateway supports.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'perplexity/sonar-pro', system: 'You are a concise technical assistant.', prompt: 'Summarize the tradeoffs between static generation and SSR.', maxOutputTokens: 1024, temperature: 0.5, });
console.log(result.text);}
main().catch(console.error);Standard parameters like prompt, messages, temperature, and tools work as documented in the AI SDK docs. These are the parameters with model-specific behavior.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID in the form creator/model, e.g. perplexity/sonar-pro. AI Gateway routes the request to an available provider. |
maxOutputTokens | number | No | Hard cap on generated tokens. Sonar Pro supports up to 8,000 output tokens. |
providerOptions | Record<string, JSONValue> | No | AI Gateway routing options under gateway, plus any provider-native options under the provider’s own namespace — see the table below. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Text | — | — | — | — | Prompt and response share the 200K-token context window |
| Image | — | URL, base64, Uint8Array | — | — | Sent as image parts in messages; counts as input tokens |
Provider options
Set AI Gateway routing options under providerOptions.gateway. For provider-specific options, pass them under the provider’s namespace as documented by the AI SDK.
Learn more in the AI SDK perplexity provider docs.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'perplexity/sonar-pro', prompt: 'Why is the sky blue?', providerOptions: { gateway: { only: ['perplexity'], }, }, });
console.log(result.text);}
main().catch(console.error);These AI Gateway routing options apply to every model. Provider-specific options pass through under the provider’s own namespace (for example providerOptions.anthropic) exactly as documented by the AI SDK.
| Parameter | Type | Required | Description |
|---|---|---|---|
providerOptions.gateway.only | string[] | No | Restrict routing to these provider slugs. Requests fail over only within the listed providers. |
providerOptions.gateway.order | string[] | No | Preferred provider order. Listed providers are tried first; unlisted providers remain available as fallbacks. |
providerOptions.gateway.sort | 'cost' | 'ttft' | 'tps' | No | Rank candidate providers by price, time to first token, or tokens per second instead of the default routing order. |
providerOptions.gateway.zeroDataRetention | boolean | No | Route only to providers with a zero-data-retention policy for this model. |
Routing across providers
AI Gateway serves the same model through multiple providers and fails over automatically. order expresses a preference while keeping every provider eligible; only is a hard allowlist — if none of the listed providers are available the request fails instead of falling back.
Options under a provider's own namespace (for example providerOptions.anthropic) are forwarded to that provider with the request. Providers ignore option namespaces that don't apply to them, so it is safe to set provider options alongside gateway routing options.
Image input
Send images alongside text as message parts. Images count as input tokens.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'perplexity/sonar-pro', messages: [ { role: 'user', content: [ { type: 'text', text: 'Describe this image.' }, { type: 'image', image: 'https://example.com/photo.jpg' }, ], }, ], });
console.log(result.text);}
main().catch(console.error);Copy link to headingAbout Sonar Pro
Sonar Pro is the enhanced tier of Perplexity's search-augmented model family. It shares the same foundational architecture as Sonar, running a live web search on every inference call. The difference: it retrieves and processes significantly more sources per query. The result is longer answers backed by a broader evidence base.
Base Sonar handles straightforward factual lookups efficiently. Sonar Pro is built for queries that demand cross-referencing. Examples include regulatory changes across multiple jurisdictions, technical comparisons of competing frameworks, or market analysis pulling from diverse sources. The model evaluates more candidate sources, weighs conflicting information, and produces longer syntheses with richer citation coverage.
Sonar Pro keeps the same developer experience as base Sonar: a single API call returns a web-grounded, cited response with no external search configuration. The context window of 200K tokens supports extended multi-turn research sessions. If you already use base Sonar, upgrading to Pro is a model identifier change with no code modifications.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: Sonar Pro searches more sources per request than base Sonar. This increases both response quality and latency. Profile response times under realistic query loads before setting user-facing timeout expectations. Web search calls bill separately (N/A per thousand when listed for this model).
- Zero Data Retention: Zero Data Retention is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Sonar Pro
Best for
- Complex research queries: Require synthesizing information from many web sources into a single answer
- Competitive analysis and market research: Breadth and depth of source coverage drive answer quality
- Technical due diligence: Compare frameworks, products, or approaches across multiple authoritative sources
- Regulatory and compliance research: Needs to cross-reference policies across jurisdictions or evolving standards
- Knowledge work: Detailed, well-cited answers justify the higher per-token cost over base Sonar
Consider alternatives when
- Simple factual lookups: Base Sonar provides sufficient accuracy at lower cost
- Chain-of-thought needed: Sonar Reasoning Pro adds structured deliberation over search results
- Minimal latency required: Base Sonar's lighter retrieval is faster for time-critical paths
- No web grounding: Pure code generation or creative writing doesn't benefit from search
Copy link to headingConclusion
Sonar Pro fits when answer quality depends on how many sources you consult and how fully they're synthesized. It delivers the depth that research and due diligence workflows expect while keeping the zero-configuration search experience that defines the Sonar family.
Copy link to headingFrequently Asked Questions
How does Sonar Pro differ from base Sonar?
Sonar Pro retrieves and processes more web sources per query, producing longer answers with broader citation coverage. Base Sonar is faster and cheaper for simpler factual queries.
Does Sonar Pro include citations?
Yes. Like all Sonar models, responses include inline citations referencing the web sources consulted. Sonar Pro typically cites more sources per response due to its deeper retrieval.
Is there an API difference between Sonar and Sonar Pro?
No. The API interface is identical. Switching from Sonar to Sonar Pro requires only changing the model identifier. You don't need code changes or configuration adjustments.
What is the context window for Sonar Pro?
200K tokens. This supports extended multi-turn research sessions where context accumulates across exchanges.
What does Sonar Pro cost?
Check the pricing panel on this page for today's numbers. AI Gateway tracks rates across every provider that serves Sonar Pro.
How do I authenticate with Sonar Pro through AI Gateway?
Use your AI Gateway API key with the model identifier `
perplexity/sonar-pro`. AI Gateway handles provider routing and authentication automatically.When should I use Sonar Pro instead of a reasoning variant?
Use Sonar Pro when you need broad source coverage and detailed synthesis but don't need explicit step-by-step reasoning. For queries that benefit from chain-of-thought deliberation over search results, use Sonar Reasoning Pro.
Your use is subject to Perplexity's Terms & Privacy Policies.