How to get a Perplexity API key, and what the Perplexity API costs
Updated · 6 min read
To get a Perplexity API key, open the API console at console.perplexity.ai, create a project, buy credits on the Billing page, and click + Generate API Key on the API keys page. The API is pay-as-you-go: there is no free tier, and a Perplexity Pro or Max subscription no longer comes with monthly API credit. The API itself changed in 2026. The old Sonar Chat Completions API is now legacy, and its successor, the Agent API, gives web-grounded answers from Perplexity's Sonar model or from OpenAI, Anthropic, Google and xAI models, with search billed per call.
Step by step
- Sign in at console.perplexity.ai with your Perplexity account, or sign up at perplexity.ai first.
- Set up the project. Click Settings under Project in the left sidebar and fill in your organization's name, address and tax details. You need a project before you can create keys.
- Add a card and credits. Click Billing, then Add payment method (payments go through Stripe, and adding a card charges nothing). Buy credits, and consider turning on Auto reload: when the balance runs out, your keys are blocked until you top up.
- Generate the key. Click API keys in the sidebar, then + Generate API Key.
- Copy it immediately. Perplexity shows the full key only once.
- Paste it into your app. The settings for different app types are below.
Free credit and Perplexity Pro
There is no free plan for the API. Perplexity's docs mention two things that come close:
- Some new accounts receive a one-time sign-up credit. It expires 60 days after it is added and is used before credits you buy. On its own it does not unlock the Agent API, the Orchestrator API or batch jobs; those need purchased credit.
- Older forum posts describe a monthly API credit for Pro subscribers. Perplexity's API docs now say: "API credits are purchased separately from Perplexity Pro and Max subscriptions. A subscription does not include API credits and is not required to use the API."
If you want a key that costs nothing, see free AI API keys.
Perplexity API pricing
Each of Perplexity's APIs bills differently. The Agent API, which gives search-backed answers, charges the token price of the model you pick plus a fee for each tool call. These were the token prices per million on 2026-11-18:
| Agent API model | Input | Output |
|---|---|---|
perplexity/sonar |
$0.25 | $2.50 |
openai/gpt-6-luna |
$0.10 | $0.50 |
openai/gpt-5.6-luna |
$0.20 | $1.20 |
perplexity/glm-5.3-flash |
$0.15 | $0.50 |
google/gemini-4-hydrogen |
$1.50 | $7.50 |
xai/grok-4.7 (under 200k input) |
$2.00 | $6.00 |
anthropic/claude-sonnet-5-5 |
$2.00 | $10.00 |
The OpenAI rates rise for inputs over 272k tokens. Tool fees come on top: a standard web_search call costs $0.0025 ($2.50 per 1,000) and a Fast Search call $0.001; fetch_url is $0.0005 per call, people and finance search $0.005, and a code sandbox $0.03 per session. The OpenAI models also offer a flex tier at half the token price and a priority tier at double.
Perplexity recommends calling the Agent API with an effort level, a preset of model, tools and prompt. On 2026-11-18 the fast level, which Perplexity suggests in place of the old sonar and sonar-pro models, ran openai/gpt-6-luna with one Fast Search. A lookup with 2,000 tokens in and 500 out costs about $0.00045 in tokens plus $0.001 for the search, before the extra input tokens that search results add.
The other two APIs are priced like this:
- Search API (ranked web results as JSON, no generated answer): $5 per 1,000 requests, or $1 with Fast Search.
- Orchestrator API (direct model access in OpenAI or Anthropic format): per token at each model's rate, with no per-request fees and no built-in web search.
Apps built for the old API send the legacy Sonar model names. Perplexity's legacy pages still list their prices (per million tokens, plus a fee per 1,000 requests that depends on search context size):
| Legacy model | Input | Output | Per 1,000 requests |
|---|---|---|---|
sonar |
$1 | $1 | $5 / $8 / $12 (low / medium / high) |
sonar-pro |
$3 | $15 | $6 / $10 / $14 |
sonar-reasoning-pro |
$2 | $8 | $6 / $10 / $14 |
sonar-deep-research |
$2 | $8 | $5 per 1,000 searches; citation tokens $2 and reasoning tokens $3 per million |
Support for Sonar Chat Completions ended on 2026-09-27, and Perplexity says these requests are being reformulated as Agent API requests, model by model. The current pricing page no longer lists the legacy rates, so check the per-model breakdown on your Billing page to see what you are actually charged.
Use the key in an app
- If the app has a built-in Perplexity option that asks for a model such as
sonarorsonar-pro, it uses the legacy Sonar API. Synchronous and streaming Sonar requests keep working, but the asynchronous mode Perplexity offered forsonar-deep-researchis no longer supported. - In apps with a custom OpenAI-compatible provider (Chat Completions), use base URL
https://api.perplexity.ai/orchestrator/v1and a full model ID such asperplexity/glm-5.3oropenai/gpt-6-luna. This gives plain model access without web search. OpenAI and Anthropic models need Tier 1 or higher, and Claude Opus 5, Opus 5.5 and Fable need Tier 2. The legacy Sonar endpoint, base URLhttps://api.perplexity.aiwith modelsonarorsonar-pro, still accepts Chat Completions requests. - In apps that use the OpenAI Responses API, base URL
https://api.perplexity.ai/v1reaches the Agent API with web search. - MCP clients can connect to Perplexity's hosted MCP server at
https://api.perplexity.ai/mcpwith the key as a bearer token; usage is billed at normal API prices.
If you use OpenRouter, it also carries Perplexity's Sonar models, so one OpenRouter key can cover them.
Rate limits and usage tiers
Your tier depends on your all-time credit purchases, not your current balance, and you never drop back down. These are the Agent API requests per second for each tier:
| Tier | Credits bought (all time) | Agent API requests per second |
|---|---|---|
| Tier 0 | $0 | 1 |
| Tier 1 | $50 | 3 |
| Tier 2 | $250 | 8 |
| Tier 3 | $500 | 17 |
| Tier 4 | $1,000 | 33 |
| Tier 5 | $5,000 | 33 |
The Agent API also has token limits per model, starting at 5 million tokens per minute on Tier 0, far more than a personal app uses. The Search API allows 50 queries per second on every tier. Limits are shared by all keys in your organization. Over a limit you get HTTP 429 with a Retry-After header; with no credits left you get 402.
Privacy
Perplexity's API Terms of Service say it does not use customer content to train generative AI models. It does keep usage metadata such as token counts, model, timestamps and the API key for billing, and how long request content is kept depends on the API, model and account settings; zero data retention is not the default.
Keep the key safe
- Use one key per app. Admins can filter usage by key on the Billing page, so you can see which app spends what.
- Revoke keys you no longer use; a revoked key cannot be restored.
- Never put the key in a website's front-end code or a public repository.
- Auto reload keeps keys working, and it also keeps spending. Check the Billing page after connecting a new app.
Apps that work with your Perplexity API key

VisitAnythingLLM
Free · macOS, Windows, Linux · Open source
Private AI app for chatting with your documents. Runs local models or connects to OpenAI, Anthropic, Gemini and others with your key.
Works with:OpenAIAzure OpenAIAnthropicGoogle Gemini+9 more



GEO citation checker that audits whether Claude, ChatGPT, Perplexity, and Gemini recommend your brand using your own API keys.
Works with:AnthropicOpenAIPerplexityGoogle Gemini+1 more

Chat interface that enhances interactions with large language models (LLMs) by providing a user-friendly frontend, supporting multiple AI models, and offering features like chat management and prompt libraries.
Works with:OpenAIAnthropicGoogle GeminiMistral+1 more

Writing assistant that enhances productivity by integrating multiple AI models, offering features like AI image generation and GPT-4 Vision capabilities.
Works with:OpenAIMistralAnthropicGoogle Gemini+1 more
Other options
To compare Perplexity's token prices with other providers, see LLM API pricing. For OpenAI's or xAI's own keys, see the OpenAI API key and Grok API key guides.
Questions
Is the Perplexity API free?
No. You buy prepaid credits and usage is deducted from them. Some new accounts get a one-time sign-up credit that expires after 60 days, but on its own it does not unlock the Agent API, the Orchestrator API or batch jobs.
Does Perplexity Pro include free API credits?
Not any more. Perplexity's API docs say credits are purchased separately from Pro and Max subscriptions, and a subscription does not include API credits.
How much does the Perplexity API cost?
It depends on the API. The Agent API charges the chosen model's token price plus tool fees: perplexity/sonar is $0.25 input and $2.50 output per million tokens, and each web search costs $0.0025 ($0.001 with Fast Search). The Search API costs $5 per 1,000 requests.
Is the Perplexity API OpenAI-compatible?
Yes. The Agent API accepts the OpenAI Responses format at https://api.perplexity.ai/v1, and the Orchestrator API accepts OpenAI Chat Completions at https://api.perplexity.ai/orchestrator/v1. The older Sonar endpoint at https://api.perplexity.ai also still answers Chat Completions requests.
What are Perplexity's API rate limits?
They depend on your usage tier, which rises with your all-time credit purchases. A new account (Tier 0) gets 1 Agent API request per second; Tier 1 ($50 purchased) gets 3, and Tier 5 ($5,000) gets 33.
Does Perplexity train on API data?
No. Perplexity's API Terms of Service say it does not use customer content to train generative AI models. Zero data retention is not the default, though.
Sources
Checked against the providers' own documentation on 2026-11-18. Prices and limits change; the links below have the current figures.
- docs.perplexity.ai/docs/getting-started/quickstart
- docs.perplexity.ai/docs/getting-started/projects
- docs.perplexity.ai/docs/getting-started/pricing
- docs.perplexity.ai/docs/agent-api/models
- docs.perplexity.ai/docs/agent-api/effort
- docs.perplexity.ai/docs/agent-api/openai-compatibility
- docs.perplexity.ai/docs/agent-api/migrate-from-sonar/overview
- docs.perplexity.ai/docs/orchestrator/quickstart
- docs.perplexity.ai/docs/admin/rate-limits-usage-tiers
- docs.perplexity.ai/docs/admin/api-key-management
- docs.perplexity.ai/docs/resources/faq
- docs.perplexity.ai/docs/resources/changelog
- docs.perplexity.ai/docs/legacy/sonar/quickstart
- docs.perplexity.ai/docs/legacy/sonar/models/sonar
- docs.perplexity.ai/docs/legacy/sonar/models/sonar-pro
- docs.perplexity.ai/docs/legacy/sonar/models/sonar-reasoning-pro
- docs.perplexity.ai/docs/legacy/sonar/models/sonar-deep-research
- openrouter.ai/api/v1/models