Skip to content
Vercel April 2026 security incident

Sonar Reasoning

perplexity/sonar-reasoning

Sonar Reasoning combines Perplexity's built-in web search with chain-of-thought reasoning. It applies structured deliberation to live search results before generating cited answers within a context window of 127K tokens.

Reasoning
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'perplexity/sonar-reasoning',
prompt: 'Why is the sky blue?'
})

What To Consider When Choosing a Provider

  • Zero Data Retention

    AI Gateway does not currently support Zero Data Retention for this model. See the documentation for models that support ZDR.

    Authentication

    AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.

Chain-of-thought reasoning generates additional tokens during the thinking phase. Budget output tokens for both the reasoning trace and the final answer. Each completion is capped at 8K tokens. Monitor per-request costs through AI Gateway's observability layer.

When to Use Sonar Reasoning

Best For

  • Analytical queries over web data:

    The answer requires logical deduction or comparison across multiple retrieved sources

  • Technical decision support:

    Compare products, frameworks, or approaches where reasoning across specifications and benchmarks is needed

  • Fact-checking and verification workflows:

    Benefit from visible chain-of-thought showing how conclusions were derived from sources

  • Multi-step research questions:

    The answer depends on connecting information from several web sources through logical steps

  • Transparent AI-assisted analysis:

    End users need to see the reasoning process alongside the cited sources

Consider Alternatives When

  • Simple factual lookups:

    Base Sonar answers faster and cheaper without the reasoning overhead

  • Maximum combined depth:

    Sonar Reasoning Pro provides both deep retrieval and reasoning

  • Latency or cost constraints:

    Reasoning trace adds unwanted latency or token cost for your use case

  • No web grounding needed:

    A standalone reasoning model like DeepSeek-R1 or OpenAI o1 may fit better

Conclusion

Sonar Reasoning is a reasoning model that searches the web. When you need to work through live evidence rather than only retrieve it, Sonar Reasoning adds the deliberation layer that base Sonar lacks while keeping citation-backed, single-call simplicity for the Sonar API.

FAQ

The model runs a live web search, retrieves relevant sources, then applies chain-of-thought reasoning to analyze the evidence before generating a final cited answer. Search and reasoning happen in a single API call.

Yes. The reasoning trace appears in the response. It shows the logical steps the model took to arrive at its conclusion from the retrieved sources.

Sonar Reasoning Pro combines deeper web retrieval (more sources, like Sonar Pro) with deeper reasoning. Sonar Reasoning uses standard Sonar-level retrieval with chain-of-thought reasoning. It's a more cost-effective option for queries that need reasoning but not exhaustive source coverage.

127K tokens. The context window accommodates multi-turn reasoning sessions where both search results and reasoning history accumulate.

See the pricing section on this page for today's rates. AI Gateway exposes each provider's pricing for Sonar Reasoning.

Use your AI Gateway API key with the model identifier `perplexity/sonar-reasoning`. AI Gateway manages provider routing and authentication. You don't need a separate Perplexity API key for gateway-managed access.

Use Sonar Reasoning when the reasoning task depends on current web information. Use a standalone reasoning model when the task can run from training data alone, such as pure math, code generation, or logic problems.