Guide · November 12, 2026

Perplexity API in 2026: Pricing, API Key, and What Replaced Sonar

Most Perplexity API guides still describe Sonar, which Perplexity stopped supporting in September. Here is how the API works now, what it costs per 1,000 calls, and how to pull citations out of the new response format.

TL;DR
The Perplexity API is now mainly two products: the Agent API, which returns a cited answer, and the Search API, which returns ranked web results at $5 per 1,000 requests. Sonar Chat Completions lost support on September 27, 2026. A fast Agent API call costs about $1.40 to $1.80 per 1,000, and keys come from console.perplexity.ai after you buy credits.

If you wired up Perplexity's Sonar API in 2025, your code calls an endpoint that Perplexity no longer supports. It still answers, for now, because Perplexity rewrites those requests behind the scenes.

The Perplexity API in 2026 gives developers web-grounded answers with citations through the Agent API, and raw ranked search results through the Search API. You pay per token plus per search, with no free tier, and choose an effort level from fast to ultra instead of a Sonar model. This guide covers pricing, keys, code, and citations.

Perplexity API in 2026: Sonar Chat Completions support ended September 27, 2026, replaced by the Agent API with effort levels and the Search API at 5 dollars per 1,000 requests.

Every price and limit here comes from Perplexity's own docs as of November 12, 2026. I tested the parsing code below against the response models in Perplexity's official Python SDK, version 0.46.1, using the response shapes its docs publish.

Disclosure: MentionsAPI publishes this blog and sells an API that checks how Perplexity, ChatGPT, and other engines mention brands. It comes up once, in the section on tracking what users see.

What is the Perplexity API in 2026?

The Perplexity API is a set of developer endpoints for web-grounded AI. The Agent API returns a generated answer with cited sources, the Search API returns ranked web results as JSON, and three smaller APIs cover model routing, embeddings, and probability scoring. Most teams that say "Perplexity API" mean the Agent API, the successor to Sonar.

Map of the Perplexity API platform in November 2026: the Agent API returns a cited answer and bills tokens plus tools; the Search API returns ranked results at 5 dollars per 1,000 requests; the Orchestrator API routes open-weight models; the Embeddings API returns vectors; the Decisions API returns calibrated probabilities.
Five APIs, one key. The Agent and Search APIs do most of the work.
  • Agent API (POST /v1/agent): an answer with sources, built by a model running web search and other tools.
  • Search API (POST /search): up to 20 ranked results per query with page text, and no generated answer.
  • Orchestrator, Embeddings, and Decisions: model routing in OpenAI or Anthropic format, vectors, and yes-or-no probabilities.

The Agent API is model-agnostic. Its model list includes OpenAI, Anthropic, Google, xAI, and open-weight models, plus Perplexity's own sonar model at $0.25 per million input tokens and $2.50 per million output tokens.

What happened to the Perplexity Sonar API?

Perplexity ended support for Sonar Chat Completions on September 27, 2026, and now recommends the Agent API for all work. Synchronous and streaming Sonar requests still return answers because Perplexity reformulates them as Agent API requests, rolling out model by model. Asynchronous Sonar requests are no longer supported and must move to the Agent API's background mode.

That date comes from Perplexity's migration guide. The guide maps each old Sonar model to an effort level, which is a preset bundle of model, search settings, step limit, and system prompt:

Old Sonar modelAgent API effortModel behind it (Nov 2026)Max steps
sonarfastopenai/gpt-6-luna1
sonar-profastopenai/gpt-6-luna1
sonar-reasoning-prolowopenai/gpt-6-luna5
sonar-deep-researchhighopenai/gpt-6.1-terra40
(new)xhighanthropic/claude-opus-5-5300

Note the third column. Most effort levels now run on OpenAI or Anthropic models that Perplexity hosts with its own search, and Perplexity can swap the model when its evals improve. Pin a version such as [email protected] if you need identical behavior month to month.

The request shape changed too. Sonar took a messages array and returned choices plus a citations list. The Agent API takes an input and returns a typed output array, with a search_results item for sources and a message item for the answer.

Sonar versus Agent API request and response: Sonar used POST /v1/sonar with a model and messages and returned choices and a citations array; the Agent API uses POST /v1/agent with an effort level and input and returns an output array containing a search_results item and a message item.
Same idea, new shape. Parsers written for Sonar need a rewrite.

If you still run Sonar code, the move takes four changes:

  • Point requests at /v1/agent and swap the model name for an effort level.
  • Send your prompt as input instead of a messages array.
  • Read sources from the search_results output item instead of a citations list.
  • Replace async Sonar jobs with background runs: send background set to true, then poll by response id.

How much does the Perplexity API cost?

The Search API costs $5 per 1,000 requests, or $1 with Fast Search. The Agent API charges model tokens plus $2.50 per 1,000 web searches, so cost depends on the effort level. In Perplexity's own benchmarks, a fast request cost $0.0014 to $0.0018, low cost $0.006 to $0.012, and high cost $0.12 to $0.14 per request.

What you callHow it billsPublished price
Search APIPer successful request$5 per 1,000 ($1 with Fast Search)
Agent API web_search toolPer invocation$2.50 per 1,000 ($1 with Fast Search)
Agent API fetch_url toolPer invocation$0.50 per 1,000
perplexity/sonar modelPer token$0.25 in, $2.50 out per 1M tokens
openai/gpt-6-luna modelPer token$0.10 in, $0.50 out per 1M tokens

The rates come from Perplexity's pricing page. A Search API request with up to five queries in an array still bills as one request, and failed or rate-limited requests are free.

Token prices alone do not tell you what a call costs, because an effort level decides how many steps and searches run. The per-request figures from Perplexity's Sonar comparison benchmarks are the closest thing to a real price list.

Cost per 1,000 Perplexity API calls in November 2026: Search API with Fast Search 1 dollar, Agent API fast 1.40 to 1.80 dollars, Search API 5 dollars, retired Sonar 5.90 to 7 dollars, Agent API low 6 to 12 dollars, Agent API medium 16 to 31 dollars, and Agent API high 121 to 136 dollars.
Ranges are Perplexity's per-request costs on two benchmarks, times 1,000.

Those benchmark numbers are Perplexity's own, measured on research-style questions. Short factual prompts use fewer tokens, and long reports use more, so check the usage.cost.total_cost field in each response for your real number.

Sep 27, 2026Sonar Chat Completions support ended (Perplexity docs)
$0.0014per fast Agent API request on BrowseComp, vs $0.0070 for Sonar
$5per 1,000 Search API requests; $1 with Fast Search

On the same benchmarks, Perplexity reports that fast scored 26.67% on BrowseComp against 7.00% for the old sonar model, at a fifth of the cost per request. That is a vendor-run test, but the direction is clear: the replacement is cheaper and stronger on multi-step questions.

How to get a Perplexity API key

To get a Perplexity API key, sign in to the API console at console.perplexity.ai, add a card and buy credits under billing, then generate a key on the API Keys page. There is no free tier, and new accounts start at usage tier 0 with one request per second. Store the key in an environment variable, never in code.

  1. Sign in at console.perplexity.ai with the account that will own billing.
  2. Open Billing, add a payment method, and buy credits. Turn on automatic top-up for production.
  3. Open the API Keys page and generate a key. Copy it immediately.
  4. Export it as PERPLEXITY_API_KEY and send it as a Bearer token on every request.

Your first call needs nothing but curl:

export PERPLEXITY_API_KEY="your_api_key_here"

curl https://api.perplexity.ai/v1/agent \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"effort": "fast", "input": "What is the best CRM for a 10-person sales team?"}'

Rate limits rise with lifetime spend. Perplexity's usage tiers run from 1 request per second at tier 0 to 33 at tier 4, which needs $1,000 in total credit purchases.

Perplexity Agent API usage tiers by lifetime credit purchases: tier 0 at 0 dollars allows 1 request per second, tier 1 at 50 dollars allows 3, tier 2 at 250 dollars allows 8, tier 3 at 500 dollars allows 17, and tiers 4 and 5 at 1,000 and 5,000 dollars allow 33.
Limits are shared across every key in your organization.

Token limits apply separately, per model, per minute and per hour. You can hit a 429 while well under your request limit, so read error.type in the response before you retry.

A value of request_rate_limit_exceeded means wait about a second, and token_rate_limit_exceeded names the window you hit. An overloaded error is not a rate limit at all, so retry with backoff or add a fallback model.

How to read citations from the Agent API

The Agent API returns sources in a search_results item, separate from the answer text, and each result has an id, URL, title, snippet, and dates. The answer marks claims with bracketed numbers that point to those ids: the fast effort level writes [1], while low, medium, and high write [web:1]. Parse both forms, and treat the results list as the source of truth.

Here is a function that does that and returns the cited URLs, every URL searched, and the call's cost:

import os
import re

import requests

API_KEY = os.environ["PERPLEXITY_API_KEY"]


def ask_perplexity(question, effort="fast"):
    """One Agent API call: the answer, the sources it cited, and what the call cost."""
    r = requests.post(
        "https://api.perplexity.ai/v1/agent",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={"effort": effort, "input": question},
        timeout=120,
    )
    r.raise_for_status()
    data = r.json()

    sources, answer = {}, ""
    for item in data.get("output", []):
        if item["type"] == "search_results":
            for result in item["results"]:
                sources[result["id"]] = result["url"]
        elif item["type"] == "message":
            answer += "".join(c.get("text", "") for c in item["content"] if c["type"] == "output_text")

    # fast cites as [1]; low, medium, and high cite as [web:1]
    cited_ids = {int(n) for n in re.findall(r"\[(?:web:)?(\d+)\]", answer)}
    usage = data.get("usage") or {}
    return {
        "answer": answer,
        "cited": [sources[i] for i in sorted(cited_ids) if i in sources],
        "searched": list(sources.values()),
        "cost_usd": (usage.get("cost") or {}).get("total_cost"),
    }

I tested it by validating sample responses against the SDK's ResponseCreateResponse model, then running the parser on them. It handled numbered markers, web-typed markers, answers with no markers, a marker pointing at a missing id, and responses without cost data.

How Agent API citations map to sources: the answer text contains markers such as [1] from the fast effort level or [web:2] from low, medium, and high; each number matches the id of a result in the search_results output item, which holds the URL, title, snippet, and dates.
Markers live in the text. URLs live in search_results.

Keep cited and searched apart. A source can appear in search_results without being cited in the answer, and only the cited ones show up as links to a reader.

Already using the OpenAI SDK? Set the base URL to https://api.perplexity.ai/v1 and call client.responses.create, since Perplexity accepts /v1/responses as an alias.

Whether the model adds citation markers is partly prompt-driven. If you override the effort level's instructions, ask for bracketed source numbers explicitly or you may get none.

Which effort level should you use?

Use fast for single facts and short answers, low for everyday research with a few searches, medium for questions that chain evidence across many sources, and high for deep research where completeness beats speed. Use xhigh only for open-ended agent work like running code. Each step up costs several times more per request, so test the cheapest level first.

  • fast: one step, Fast Search, about $1.40 to $1.80 per 1,000 calls.
  • low: up to 5 steps with URL fetching, about $6 to $12 per 1,000.
  • medium: up to 15 steps, about $16 to $31 per 1,000.
  • high: up to 40 steps, about $121 to $136 per 1,000.

The jump from medium to high is the one to watch. On Perplexity's benchmarks it added 4 to 6 points of accuracy for roughly four to eight times the cost per request.

You can also override any part of an effort level, such as the model, max_steps, or tools, by passing it next to effort. That is how you keep fast's search setup while swapping in perplexity/sonar or a model your team already trusts.

When to use the Search API instead

Use the Search API when you want Perplexity's ranked web results but plan to write the answer with your own model, or need no answer at all. It returns up to 20 results per query with title, URL, extracted page text, and dates, for a flat $5 per 1,000 requests. There is no token bill, so costs stay predictable.

One request can carry up to five related queries and still bill once, though each query uses a rate-limit unit. Filters cover up to 20 domains, up to 20 languages, recency, date windows, and a country code.

Two details trip people up. A result's snippet can come back empty, so check it before you hand it to a model, and a successful request with zero results still bills.

The tradeoff is simple: the Agent API costs more per call but writes and cites the answer for you. The Search API is cheaper and more controllable, and leaves the writing, citing, and prompt work to your code.

Does the Perplexity API show what perplexity.ai users see?

Not reliably: in the API, your effort level picks the model, and most effort levels run on OpenAI or Anthropic models with Perplexity's search. The perplexity.ai app runs its own configuration, personalization, and model choices. So an API answer tells you what that configuration says, which may differ from what a real Perplexity user reads for the same question.

That matters if you are measuring brand visibility. AI answers also vary run to run: a SparkToro and Gumshoe study found less than a 1-in-100 chance that an AI tool repeats the same brand list for one prompt, Search Engine Journal reported.

For product features, like answering questions with sources inside your app, the Agent API is the right tool. For monitoring how Perplexity presents your brand to its users, sample the live app answer, on many prompts, over several weeks.

The API tells you what a model with Perplexity's search says. Only the live app tells you what Perplexity users read.The rule for brand tracking

MentionsAPI's perplexity_live mode captures the live perplexity.ai answer with its inline citations for 85 credits per call. Its quick mode checks ChatGPT, Claude, Gemini, and Perplexity together for 150 credits.

See what Perplexity users read
MentionsAPI captures live Perplexity answers with citations and checks whether your brand is mentioned and ranked, alongside ChatGPT, Claude, and Gemini. 300 free credits, no card.

Mistakes to avoid with the Perplexity API

Most Perplexity API problems in late 2026 come from code written for Sonar. The old endpoint still answers, which hides the migration until something breaks, and the citation format, cost model, and response shape all changed. These are the mistakes worth checking for first, roughly in order of how often they bite.

  1. Leaving production on the Sonar endpoint because it still answers.
  2. Parsing only [1] markers and missing every [web:1] citation from low, medium, and high.
  3. Reading a top-level citations array that the Agent API does not return.
  4. Running high or xhigh on simple lookups that fast answers for a hundredth of the price.
  5. Retrying 429s blindly instead of checking whether the request or token limit was hit.
  6. Treating API answers as proof of what perplexity.ai shows its users.

Frequently asked questions

Is the Perplexity API free?
No. Perplexity documents no free API tier. The API runs on prepaid credits: you add a card in the API console, buy credits, and each call draws them down. New accounts start at usage tier 0 with a limit of one request per second. A single fast Agent API call costs well under a cent, so a few dollars of credit covers a lot of testing.
How much does the Perplexity API cost?
It depends on which API you call. The Search API costs $5 per 1,000 requests, or $1 with Fast Search. The Agent API bills model tokens plus $2.50 per 1,000 web searches. In practice, Perplexity measured its fast effort level at about $0.0014 to $0.0018 per request, roughly $1.40 to $1.80 per 1,000 calls, while high runs above $0.12 per request.
How do I get a Perplexity API key?
Sign in to the Perplexity API console at console.perplexity.ai, add a payment method and buy credits under billing, then open the API Keys page and generate a key. Copy it once, store it in an environment variable named PERPLEXITY_API_KEY, and send it as a Bearer token. Keys are shared across your organization, so rotate any key that leaks.
Is the Perplexity Sonar API still available?
Not as a supported product. Perplexity ended support for Sonar Chat Completions on September 27, 2026. Synchronous and streaming Sonar requests still work for now because Perplexity rewrites them into Agent API requests, but asynchronous Sonar requests no longer work. The sonar model itself remains selectable inside the Agent API at $0.25 input and $2.50 output per million tokens.
Can I use the OpenAI SDK with the Perplexity API?
Yes. The Agent API follows the Open Responses format, so you can point the OpenAI SDK at Perplexity by setting the base URL to https://api.perplexity.ai/v1 and calling client.responses.create with your Perplexity key. Perplexity accepts /v1/responses as an alias for its /v1/agent endpoint. A few behaviors differ, such as how MCP tool approvals default.
Does the Perplexity API return the same answers as perplexity.ai?
You should not assume it does. In the API, the effort level picks the model that writes the answer, and Perplexity lists OpenAI and Anthropic models behind most of them. The perplexity.ai app runs its own configuration. If you need to know what Perplexity users actually see for a question, capture the live app answer instead of the API answer.

Move off Sonar, then pick the cheapest effort that works

The Perplexity API in 2026 is the Agent API for cited answers and the Search API for raw results. Move any Sonar integration now, start new work on the fast effort level, and parse both citation formats. Then check usage.cost.total_cost on real traffic before you raise the effort level.

Pin an effort version in production. Perplexity moved fast to a new model in August 2026, and it will move again.

Nikhil Kumar
Founder, MentionsAPI

Growth marketer at the intersection of marketing, product, and technology. 8+ years across startups and scale-ups in India, Switzerland, and the Netherlands. Founder of Landkit (landkit.pro).

Track how Perplexity talks about you.

Check whether Perplexity, ChatGPT, Claude, and Gemini mention, rank, and cite your brand for any prompt, in one API call. 300 free credits, no card.