Perplexity · Text · API

Perplexity Sonar API — live pricing and a 5-minute setup

Perplexity Sonar API: Sonar, Sonar Pro and Sonar Reasoning Pro with built-in web search through one Zerocoder key. No extra per-search fee.

Perplexity Sonar models answer with live web search: for every request the model finds fresh pages itself and writes an answer with sources. Through Zerocoder, Sonar, Sonar Pro and Sonar Reasoning Pro are served on the OpenAI-compatible /v1/chat/completions with streaming — no Perplexity account needed.

Search is built into the model and is not billed separately: you pay only per token — input and output at their own prices — with a minimum per call and a refund if the answer never starts. Below are the live prices of all three models, a calculator and code samples.

Models and prices

The live GET /v1/models price list in US dollars. Minimum per call: $0.00556. Endpoints: /v1/messages, /v1/chat/completions

Model prices in US dollars; where we are cheaper, the vendor's official price for the same unit is struck through
ModelPriceUnit
Perplexity Sonarrecommendedsonar · Perplexity
input $0.60 / output $0.60per 1M tokens
Perplexity Sonar Prosonar-pro · Perplexity
input $0.72 / output $3.36per 1M tokens
Perplexity Sonar Reasoning Prosonar-reasoning-pro · Perplexity
input $0.60 / output $1.92per 1M tokens
All prices are in US dollars; Zerocoder prices are converted at the internal rate.

Cost calculator

Pick a model and a volume — the calculator uses the same formulas as API billing.

per call$0.00556
per month · 1,000$5.56

input $0.60 / output $0.60 per 1M tokens

minimum per call: $0.00556

Prices from GET /v1/models in US dollars at the internal rate. Failed generations are not charged.

  1. Get a keyin the API dashboard
  2. Top up the walletby card or invoice
  3. Make the callPOST /v1/chat/completions, model sonar
First request

Connect the Perplexity Sonar API: change two values

The OpenAI SDK in Python and Node.js, the Anthropic SDK or curl: swap the base URL and the key — requests, streaming and response handling stay as they are. Perplexity Sonar answers on POST /v1/messages and /v1/chat/completions.

Base URL
https://zerocoder.com/api/v1

Anthropic SDK — https://zerocoder.com/api, without /v1

Model in the samples — sonar; any model from the table works

from openai import OpenAI client = OpenAI(    base_url="https://zerocoder.com/api/v1",    api_key="zc-sk-…",) r = client.chat.completions.create(    model="sonar",    messages=[{"role": "user", "content": "Hello!"}],)print(r.choices[0].message.content)
import OpenAI from "openai"; const client = new OpenAI({  baseURL: "https://zerocoder.com/api/v1",  apiKey: "zc-sk-…",}); const r = await client.chat.completions.create({  model: "sonar",  messages: [{ role: "user", content: "Hello!" }],});console.log(r.choices[0].message.content);
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({  // without /v1: the SDK appends /v1/messages itself  baseURL: "https://zerocoder.com/api",  apiKey: "zc-sk-…",}); const msg = await client.messages.create({  model: "sonar",  max_tokens: 300,  messages: [{ role: "user", content: "Hello!" }],});console.log(msg.content[0].text);
# Anthropic Messages formatcurl https://zerocoder.com/api/v1/messages \  -H "x-api-key: zc-sk-…" \  -H "content-type: application/json" \  -d '{"model": "sonar", "max_tokens": 400,       "messages": [{"role": "user", "content": "Hello!"}]}' # OpenAI chat/completions format, streamingcurl -N https://zerocoder.com/api/v1/chat/completions \  -H "authorization: Bearer zc-sk-…" \  -H "content-type: application/json" \  -d '{"model": "sonar", "stream": true,       "messages": [{"role": "user", "content": "Hello!"}]}'

How to connect the Perplexity Sonar API: first request in 5 minutes

From a key to production — six steps based on the real /api/v1 contracts. Each step links to the relevant docs section.

  1. 1

    Get a key in your account

    Sign up, open the API section of your account, top up the balance and create a zc-sk-… key. One key unlocks Perplexity Sonar and every other model in the catalogue.

    Read more →
  2. 2

    Send the first request

    POST /v1/chat/completions (Bearer) or /v1/messages (x-api-key) with model and messages — OpenAI and Anthropic shapes, the SDKs work with a swapped base URL.

    Read more →
  3. 3

    Turn on streaming

    stream: true — the answer arrives as SSE chunks with a final billing event showing the real charge. The reserve is taken by max_tokens (default 8192), so set it to fit the task.

    Read more →
  4. 4

    Handle limits and errors

    30 requests per minute per key: on 429 wait and retry with a growing pause; 402 — top up the balance; 400 — check model against GET /v1/models. Failed generations are not charged, so retrying is safe.

    Read more →
  5. 5

    Watch the budget

    GET /v1/balance returns the balance and 30-day spend; every call's price comes back in the response — write it to your logs and set an alert threshold in your own monitoring.

    Read more →
  6. 6

    Ship to production

    Keep the key in server secrets, never in the frontend. For high Perplexity Sonar volumes contact us — the limit is raised individually and companies can pay by invoice. Check the observed stability on the status page.

    Read more →

No code

Any tool that can make an HTTP request can call our API: one POST with the x-api-key header.
HTTP Requestn8n

HTTP Request node: POST to the /api/v1 endpoint, x-api-key header and a JSON body built from workflow fields. For video add a Wait node and a second HTTP Request on GET ?id= in a loop until completed.

HTTP → Make a requestMake

HTTP “Make a request” module: POST, Body type JSON, x-api-key header. The response is parsed automatically — the image url or the answer text flows into the next modules.

Webhooks by ZapierZapier

Webhooks by Zapier → Custom Request action: POST, Data — JSON with model and prompt, Headers — x-api-key. Response fields are available to the following Zap steps.

Apps ScriptGoogle Sheets

In Apps Script use UrlFetchApp.fetch with method post, contentType application/json and a payload from the cells: prompts in one column, results written to the next one.

any bot frameworkTelegram bot

A bot on aiogram, grammY or Telegraf calls the same HTTP API: user message → model request → reply in the chat. For video — poll the status and send the file from the finished URL.

OpenAI-compatible base URLPython / Node SDK

For text models the official OpenAI and Anthropic SDKs work with a swapped base URL and our key — your application code stays the same. Images and video are a plain HTTP call from any language.

For business

We'll help bring AI into your business

More than a key: we help wire Perplexity Sonar and other models into your workflows — from audit to production, with invoice payment.

  • Process auditWe find where AI pays off in your workflows: support, sales, content, documents — and name specific scenarios and models.
  • Integration into CRM, website, Telegram, n8nWired through our API or ready no-code scenarios; one key and a shared balance for every model.
  • Payment by invoiceCompanies get an invoice for bank transfer, accounting documents and a top-up of the API balance.
  • Support and limitsHelp with prompts and architecture, request limits raised individually for your load.

Inputs, limits and refunds

  • Two shapes: Anthropic Messages (/v1/messages, x-api-key) and OpenAI chat/completions (Bearer)
  • Streaming: Anthropic SSE with a billing event at the end; OpenAI chunks and data: [DONE]
  • Input and output tokens are billed at their own per-1M prices (output costs more), minimum per call in min_rub
  • A reserve by max_tokens (default 8192) is taken before the answer and settled after
  • Failure before the first token — the reserve is refunded
  • Image input only via the separate vision model (model: vision); images sent to the models on this page return 400 model_no_vision with nothing charged
  • 30 requests per minute per key (all endpoints combined); model: smart picks the model tier itself

Error responses and refunds

# 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid or revoked API key."}}
# 402 {"type":"error","error":{"type":"billing_error","message":"Not enough API balance: …"}}
# 429 {"type":"error","error":{"type":"rate_limit_error","message":"…"}}   ← 30 requests/min per key
# 400 {"type":"error","error":{"type":"invalid_request_error","message":"Unknown model \"…\". See GET /v1/models."}}
# /chat/completions uses the OpenAI envelope: {"error":{"message":"…","type":"…","code":"insufficient_balance"}}
# streaming: the reserve (by max_tokens) is settled after the answer; a failure before the first token is refunded
# event: billing {"charged_rub":…,"reserved_rub":…,"balance_rub":…,"unit":"1M_tokens","rub_per_mtok_in":…,"rub_per_mtok_out":…,"rub_per_mtok":…}

Observed stability of the API and text models

Numbers come from the public /status summary: the share of successful requests over a period for the whole API and for the category as a whole (the summary has no per-model breakdown), no SLA promises. Failed generations are not charged, so retrying is safe.

Developer APIoperational

—now (2 h window)
74.5%last 30 days
74%last 90 days

Text & chatoperational

—now (2 h window)
99%last 30 days
94.5%last 90 days

Refunds and charges

  • Failure before the first token — the reserve is refunded in full
  • The max_tokens reserve is settled after the answer — only the real volume is charged
  • In streaming the real charge arrives as the billing event

Tracking since Aug 8, 2026.

Use cases

1

Answers about recent events, prices and news, with sources

2

Monitoring competitors, markets and brand mentions

3

Topic briefs and overviews that cite the pages they use

4

Fact-checking articles and other models' answers

5

Search assistants and bots that need up-to-date data

6

In-depth analysis of complex questions on the reasoning model

Prompting tips

  • Phrase the question as you would search: specific names, region, period.
  • Ask for a source next to every claim — the answer is easier to verify.
  • Use Sonar for quick facts, Sonar Pro for overviews and Sonar Reasoning Pro for multi-step questions.
  • State the answer language explicitly: sources come in many languages, the answer should not.
  • Do not send a long dialogue history — search depends on the latest question and a short context.
  • Cap max_tokens for the format: a short brief costs less than a long overview.

Ready-made prompts for Perplexity Sonar

Copy the prompt and the parameters into the request body — the fields are named exactly as in the /api/v1 contract. Replace the angle-bracket placeholders with your material.

Latest news on a topic

What important things happened in “<topic>” over the past week? Give five points, each with a source.
system: Answer in English, as a list, with a source after every point.max_tokens: 800

Competitor monitoring

Which new products, prices and promotions has “<company>” announced in the past month? Cite sources.
max_tokens: 700

Fact check

Is it true that <claim>? Answer “yes”, “no” or “unconfirmed” and give sources.
system: Give the verdict in one word first, then two or three sentences of reasoning.max_tokens: 400

Brief for an article

Put together a short brief on “<topic>”: definition, key figures, recent events. A source for every fact.
max_tokens: 1200

Hard question with reasoning

<a multi-step question that needs data compared across several sources>
model: sonar-reasoning-promax_tokens: 1500

Use the reasoning model for such questions — it costs more than the base one.

Who the Perplexity Sonar API is for

Industries where this kind of generation becomes part of the workflow rather than an experiment.

SaaS & appsAn AI assistant inside your product: OpenAI or Anthropic shape, Perplexity Sonar via a swapped base URL.
Support & CRMTicket replies, classification, conversation summaries for managers.
E-commerceProduct descriptions, SEO copy, review replies — in bulk across the catalogue.
EdTechGrading, explanations at the learner's level, quiz generation.
Documents & legalDigests, version comparison, field extraction into structured data.
Media & contentArticle drafts, rewrites, headlines and translations — Perplexity Sonar in the editorial pipeline.

FAQ

How much does the Perplexity Sonar API cost, and is search billed separately?

Perplexity Sonar is billed only per token: each model has two prices per million tokens — input and output — in the table above and in GET /v1/models, plus a per-call minimum. Web search is built into the model and carries no separate per-request fee.

How does Perplexity Sonar search the web through the API?

Search is built into the Perplexity Sonar models: for every request the model finds fresh pages itself and writes an answer grounded in them, with sources. No extra parameter is needed to turn search on — just ask the question in messages on /v1/chat/completions.

How do Sonar, Sonar Pro and Sonar Reasoning Pro differ?

In the Perplexity Sonar line the base Sonar gives quick answers and facts, Sonar Pro fuller overviews across several sources, and Sonar Reasoning Pro handles multi-step questions with reasoning. All three use one key with their own id from the table, at different prices.

How do I connect the Perplexity Sonar API with the OpenAI SDK?

Set base_url to zerocoder.com/api/v1 and a zc-sk-… key in the OpenAI SDK, and the Perplexity Sonar model id from the table in model. The /v1/chat/completions format and streaming match OpenAI, so existing code barely changes. Python, Node.js and curl samples are in the “First request” block.

What limits and refund rules apply to the Perplexity Sonar API?

A shared key limit of 30 requests per minute across all API endpoints; above it, 429. If the Perplexity Sonar answer never starts, the max_tokens reserve is refunded automatically; format errors are free. These models take no image input — a request with an image returns 400 with nothing charged.

Can a legal entity top up the Perplexity Sonar API balance with an invoice?

Yes. Request an invoice in the API dashboard and pay from the company account; the credited amount is spent on Perplexity Sonar and any other model with the same key. Card top-ups are instant, and accounting documents are provided on request. No Perplexity account needed.

Are there free requests to the Perplexity Sonar API?

There are no free requests: the API wallet opens with a minimum first top-up, then every Perplexity Sonar call is charged per token with a per-call minimum. For a cheap test use the base Sonar and short questions — the cost shows in the billing block of the response.

Is Perplexity Sonar a good fit for news monitoring and fact-checking?

Yes, that is the core strength of Perplexity Sonar: the model answers from fresh web pages and cites sources, so it is used for market and mention monitoring, topic briefs and checking claims. Ask for a source next to every fact — the answer is easier to verify.

AI API for your product

One key for every model, pay per call