Bot TutorialsGrok BotChatGPTClaudeGeminiCopilotPerplexityMore botsGuidesArticlesPapersIndustrialSearch
Step-by-stepLessonsAPI tutorial

Perplexity API tutorial: keys, first request, pricing, limits

For developers. All numbers come from docs.perplexity.ai.

On this page: What the API is · Step 1: Get a key · Step 2: First request (Agent API) · Step 3: Tool fees · Step 4: Search API (raw results) · Step 5: Rate limits and tiers · Step 6: Privacy and gotchas · Cost example

What the API is

The Perplexity API lets your own code get web-grounded answers. It has its own console, billing and prepaid credits, separate from a Pro or Max subscription. Perplexity's docs list several APIs:

APIPrice (per the docs)
Agent APIPer token for the model, plus tool fees
Search API$5 per 1,000 requests (Fast Search: $1 per 1,000)
Embeddings$0.004 to $0.05 per million tokens
Decisions APIListed per million input tokens
OrchestratorPrivate preview

Step 1: Get a key

Sign in to the API console, open your project's API keys page and create a key. Save it in an environment variable, not in your code.

export PERPLEXITY_API_KEY="pplx-..."   # never commit this

Add credits on the Billing page. You can turn on auto top-up, but set a limit you're comfortable with. If you run out of credits, requests fail with HTTP 402.

Step 2: First request (Agent API)

curl https://api.perplexity.ai/v1/agent \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"effort":"low","input":"List three official sources on US passport renewal times."}'

The effort setting can be fast, low, medium, high or xhigh. Higher effort does more work and costs more, so start low.

Step 3: Tool fees

The Agent API charges for the tools it uses, on top of tokens (docs):

ToolFee per call
web_search$0.0025 (fast: $0.001)
fetch_url$0.0005
people_search / finance_search$0.005
sandbox$0.03 per session

You can restrict web search to certain domains with a domain filter. It's cheaper and gives cleaner answers.

Step 5: Rate limits and tiers

Your tier rises with how much you've bought in total (docs):

TierTotal purchasesAgent queries per second
0$01
1$503
2$2508
3$50017
4$1,00033
5$5,00033

If you hit HTTP 429, retry with exponential backoff.

Step 6: Privacy and gotchas

Cost example

Say you make 2,000 Agent calls a month, and each one runs 1 web search ($0.0025): that's $5.00 in search fees, plus token costs. Check token prices on the docs pricing page before you plan a budget.

Where these facts come from

Checked Oct 29, 2026. Plans change, so confirm on the official page before you pay.

Next: ChatGPT tutorial →

Related: FAQGrok Bot lessonsChatGPT lessonsClaude lessonsGemini lessonsCopilot lessonsPerplexity lessonsCatch made-up answersStop burning creditsWhich bot for whatFiles safelyScripts & templatesWorkflowsMore bot lessons