Perplexity built its reputation on one thing: you ask a question, it searches the web, and it hands back an answer with citations. The Sonar API is that same loop, sold as an endpoint. You send a prompt, Perplexity runs the search and the model, and you get a finished answer back.
That is genuinely convenient. It is also a very specific product, and it gets bought for the wrong job all the time. Let's walk through how it works, what it actually costs (the pricing has a gotcha), and when you'd be better served by a different shape of API.
What the Sonar API Actually Is
Sonar is not a search API in the traditional sense. You don't get ten blue links. You get a chat completion, generated by one of Perplexity's models, grounded in a web search that Perplexity runs on your behalf.
The endpoint is OpenAI-compatible, which makes integration painless if you already have an OpenAI-style client lying around:
import requests
r = requests.post(
"https://api.perplexity.ai/chat/completions",
headers={"Authorization": "Bearer pplx-YOUR_KEY"},
json={
"model": "sonar",
"messages": [
{"role": "user", "content": "What changed in the EU AI Act enforcement this month?"}
],
},
)
data = r.json()
print(data["choices"][0]["message"]["content"])
print(data["search_results"]) # the sources it used
The response includes the generated answer plus a list of search results the model consulted: titles, URLs, and publish dates. You can steer the search with parameters like search_domain_filter (restrict or exclude domains), search_recency_filter (only recent pages), and web_search_options.search_context_size, which controls how much web content gets pulled into the model's context.
There are four models that matter:
- sonar: the fast, cheap default for straightforward Q&A.
- sonar-pro: bigger context, more thorough retrieval, better on multi-step questions.
- sonar-reasoning-pro: adds chain-of-thought reasoning on top of search.
- sonar-deep-research: runs many searches autonomously and writes a long report. Slow, and billed differently.
What It Costs (Read the Request Fees Twice)
Token prices look cheap at first glance. The catch is that Sonar bills two meters at once: tokens, plus a per-request fee that scales with search_context_size. Here is the picture as of mid 2026 (check Perplexity's pricing page for current numbers):
| Model | Input / Output (per 1M tokens) | Request fee (per 1,000 requests) |
|---|---|---|
| sonar | $1 / $1 | $5 low, $8 medium, $12 high |
| sonar-pro | $3 / $15 | $6 low, $10 medium, $14 high |
| sonar-reasoning-pro | $2 / $8 | $6 low, $10 medium, $14 high |
| sonar-deep-research | $2 / $8 (plus $2/M citation tokens, $3/M reasoning tokens) | $5 per 1,000 searches it runs |
Do the math on a realistic query and the request fee usually dominates. A typical sonar call with medium context might use a few thousand tokens, call it half a cent. The request fee on that same call is $8 per thousand, or 0.8 cents. So the "$1 per million tokens" headline number is maybe a third of your real bill, and on sonar-pro with high context you're paying 1.4 cents per call before a single token is counted.
Deep research is its own animal: one API call can trigger dozens of internal searches and a lot of reasoning tokens. Budget per report, not per request, and expect single reports to cost tens of cents or more.
None of this makes Sonar expensive in absolute terms. It makes it hard to predict, which is the actual complaint I hear from teams running it at volume.
What Sonar Is Good At
If your product is "user asks a question, product shows an answer with sources," Sonar is close to a drop-in backend. Perplexity handles query formulation, retrieval, ranking, and generation. You handle nothing. For a support bot that needs current information, or a research sidekick inside a dashboard, that is a legitimately fast path to shipping.
The citations are real URLs, the recency filtering works, and the OpenAI-compatible schema means switching an existing chat feature over is an afternoon of work.
Where It Falls Short
The convenience has a flip side: Sonar is a closed loop, and you live inside it.
You can't bring your own model. The answer is generated by Perplexity's model, with Perplexity's prompting, at Perplexity's temperature. If your product runs on Claude or GPT and you want one consistent voice, tone, and tool-use behavior across features, a second opinionated model in the middle of your pipeline is a liability.
You get an answer, not the material. Sonar returns generated text plus source URLs. It does not return the page content it read. If you want to verify a claim, chunk sources into a vector store, extract structured fields, or re-answer with your own prompt, you have to go fetch those URLs yourself, and now you're back to fighting bot walls and HTML parsing on your own.
Search is not controllable at the retrieval layer. You can filter domains and recency, but you can't see or reshape the query fan-out, re-rank results with your own logic, or cache retrieved content across requests. For agentic systems that decide what to read next, that opacity hurts. I wrote more about why that loop matters in what agentic search actually is.
The Alternatives, By Shape
The useful way to compare alternatives is by what the API returns, not by brand.
| Shape | Examples | You get | You still need |
|---|---|---|---|
| Answer API | Perplexity Sonar | Finished answer plus citations | Nothing, but you control little |
| Search only (snippets) | Brave Search API, Serper, SerpApi | Links, titles, snippets | Your own fetching, parsing, and LLM |
| Search plus content | Tavily, Exa, link.sc | Ranked results with page content | Your own LLM |
Snippet APIs are the cheapest per call, but snippets rarely contain the answer, so you end up building a fetch-and-clean pipeline anyway. That pipeline is the hard part; I covered the failure modes in real-time web search for LLMs.
The search-plus-content shape is the middle path that keeps control on your side. link.sc is built around it: the /search endpoint returns real-time results with each page's full content already extracted as markdown, and the /fetch endpoint reads any single URL, escalating to a stealth browser only when a site demands it.
curl -X POST https://api.link.sc/v1/search \
-H "x-api-key: lsc_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "EU AI Act enforcement changes"}'
Feed that markdown to whatever model you already run, with your own prompt and your own citation format. Pricing is flat per request, so cost scales with call volume instead of with an opaque context-size setting.
How to Choose
Pick Sonar if you want a finished, cited answer and you're fine with Perplexity's model doing the talking. It is the fastest route from zero to a working answer feature.
Pick a search-plus-content API if you have your own model and you want the retrieval layer as raw material: RAG pipelines, agents, extraction jobs, or any product where you need to control the prompt and keep the sources. The link.sc docs cover both endpoints if you want to see the response shapes before committing.
And if you're on snippet APIs today, run the numbers on your fetch pipeline's maintenance time before assuming they're the cheap option. They usually aren't.
Get 500 free credits a month for search with full-page content at link.sc/register.