Skip to content
← Tools / Skills
ToolPerplexity AI/10 trustMetrics-checked
Perplexity Sonar API logo

Perplexity Sonar API

Search-grounded answer API: Sonar models with live web retrieval baked into every call.

Visit official site →

About

Sonar is Perplexity's developer API (distinct from the consumer chatbot). Models: sonar ($1/$1 per 1M in/out), sonar-pro ($3/$15), sonar-reasoning-pro ($2/$8), sonar-deep-research ($2/$8 plus search fees) — all with live web retrieval. On top of tokens, per-request search-context fees ($5–$14/1k requests) apply; a flat Search API ($5/1k requests) returns ranked results without generation.

Official SDK @perplexity-ai/perplexity_ai (TypeScript). Pay-as-you-go with prepaid credits; no permanent free tier. Pricing verified via docs.perplexity.ai and multiple independent analyses (April–Oct 2026).

What it can do

  • Sonar, Sonar Pro, Reasoning Pro, Deep Research models
  • Live web retrieval with citations in every call
  • Flat Search API ($5/1k requests)
  • Official TypeScript SDK
  • Agent API proxying third-party models with search

Setup

  1. Create an account at perplexity.ai and generate an API key.
  2. Add prepaid credits (no subscription required).
  3. Install the SDK: npm i @perplexity-ai/perplexity_ai.
  4. Call client.chat.completions.create({ model: 'sonar-pro', messages }) with your API key.
  5. Budget for search-context fees on top of tokens.

Prerequisites

Perplexity account with prepaid API credits; API key.

Use cases

searchcodedata

Works with

Generic APIClaude CodeCursorAny agent (.md)

Trust score — 7/10

/10 trustMetrics-checked

Scored 7/10 (metrics tier). Major, well-documented API with an official SDK and independently verified pricing, but closed and the compounding fee structure (tokens + search-context fees) is a real cost surprise documented by third parties. No free tier. High adoption, capped by closedness — metrics tier per the 8+ rule.

How the trust score is built

Full methodology →
Adoption · stars/downloads, log-scaled vs peers
9.0/10
Maintenance · recency, releases, issue load
5.0/10
Openness · license + docs
4.8/10
Manual review · sanity read + red-flag check
9.0/10
  • · provider-tier estimate — thinner evidence (no public adoption metric)
  • · major search API; official SDK verified — provider-tier estimate
  • · no release date — neutral maintenance score
  • · manual review: Sonar pricing verified via docs + independent analyses; pay-as-you-go, no free tier; search-context fees compound; license: closed API (Perplexity)

Sources

Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.