HomeAPIs › Perplexity

Perplexity Sonar API — pricing & how to get a key

Perplexity's Sonar API gives you LLM answers that are connected to live web search and return citations — the same engine behind Perplexity's answer engine. That makes it great for up-to-date Q&A and research apps, but it bills differently from a plain LLM: you pay for tokens and a per-request search fee. Here's the full picture and how to get your key.

Perplexity API pricing (reference, June 2026)

ModelInput $/1MOutput $/1MBest for
Sonar cheapest$1.00$1.00Fast cited answers
Sonar Pro$3.00$15.00Deeper research, longer answers
Search request fee~$5.00 per 1,000 requestsCharged on top of tokens
⚠️ Reference prices, June 2026 — Perplexity updates Sonar pricing and tiers regularly. Confirm on docs.perplexity.ai before budgeting. The search request fee is separate from tokens and often dominates the bill for high-traffic apps.

→ Estimate the token side on the AI API cost calculator, then add your request count × the search fee.

Is there a free tier?

There's no open free API tier, but Perplexity Pro subscribers get monthly API credits (around $5) to test with. For a genuinely free LLM quota, see Google Gemini or Mistral — though neither includes built-in web search like Sonar.

How to get a Perplexity API key (step by step)

1. Sign in at perplexity.ai and open Settings → API.
2. Add a payment method (or use included Pro credits) to activate API access.
3. Click Generate API Key and copy it once.
4. The endpoint is OpenAI-style; point your OpenAI SDK at the Perplexity base URL.

Test it with a simple request:

# quick test (replace $PPLX_API_KEY)
curl https://api.perplexity.ai/chat/completions \
-H "Authorization: Bearer $PPLX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"sonar","messages":[{"role":"user","content":"What happened in tech today?"}]}'

Watch the search fee

The single most common surprise on a Perplexity bill is the per-request search charge. At ~$5 per 1,000 requests, an app doing 100,000 answer requests a month pays ~$500 in search fees before token cost. If you don't need live web data on every call, route generic questions to a cheaper plain LLM and reserve Sonar for queries that truly need fresh, cited information.

Cheaper alternatives

If you don't need built-in search, a plain LLM is far cheaper: Gemini Flash, DeepSeek or GPT-4o mini. To add your own search, pair one of those with a search API. For one key across many models, see OpenRouter.

FAQ

Why does Sonar cost more than its token price?

Because each request can trigger a live web search billed separately (~$5 per 1,000 requests). For high request volumes the search fee, not tokens, dominates the bill.

Does Perplexity have a free API tier?

No open free tier, but Pro subscribers receive monthly API credits to test with.

How do I get a Perplexity API key?

Open Settings → API at perplexity.ai, add billing or use Pro credits, generate a key and copy it once.

When should I use Sonar instead of a normal LLM?

When answers must reflect current events or cite live sources. For static knowledge, a plain LLM is cheaper and faster.

Not affiliated with Perplexity. Prices are reference estimates — always verify on the official pricing page.