<!-- twin of https://specstream.ai/migrate/perplexity -->
# Perplexity Search API compatible: change the address, keep the code

Compared on Nov 10, 2026. The page: https://specstream.ai/migrate/perplexity

SpecStream answers Perplexity's `POST /search` in Perplexity's own JSON, at $0.005 a search of up to 10 results. Every line below was measured on production on November 10, 2026 with the `perplexityai` Python SDK 0.46.1.

The switch is one line: `base_url="https://api.specstream.ai/perplexity"` in place of `https://api.perplexity.ai`, and a SpecStream key as the Bearer token. Your code reads `results[].title`, `url`, `snippet` and `date` as before.

SpecStream scores 97.9 F-score on all 1,000 SimpleQA Verified questions and 64.0 item F1 on all 200 WideSearch tasks. A page text budget costs nothing extra, and new accounts get $10 of credit.

[Get an API key](https://specstream.ai/signup?src=alternatives-migrate-perplexity&utm_source=alternatives-md&utm_campaign=migrate-perplexity&returnTo=%2Fworkspace%2Fsearch%3Froute%3Dperplexity) New accounts get $10 of credit, no card. It covers 2,000 searches.

## Perplexity Search API to SpecStream, parameter by parameter and field by field

| | SpecStream | Perplexity Search API |
|---|---|---|
| Address | `POST https://api.specstream.ai/perplexity/search` | `POST https://api.perplexity.ai/search` |
| The key | A SpecStream key as `Authorization: Bearer` | A Perplexity key as `Authorization: Bearer` |
| `max_results` | 1 to 20 for web search, 10 when you send none, and up to 50 with `search_type` `people`. 21 on a web search gets Perplexity's `422` | 1 to 20, default 10 |
| `query` | A string, or a list that holds one query. A list of two or more gets a `422` that asks for one query per call | A string or an array of strings |
| Filters | `search_domain_filter` (a `-` before a domain leaves it out), `search_recency_filter`, `search_after_date_filter` and `search_before_date_filter` as MM/DD/YYYY. Another date form gets a `422` | The same filters, with dates as MM/DD/YYYY |
| Page text | `max_tokens_per_page` and `max_tokens` fill each `snippet` with the page's text, cut to the budget, at no extra cost | `max_tokens` and `max_tokens_per_page` leave the price as it is |
| The reply | `id`, `results[]` with `title`, `url`, `snippet` and `date` when the page has one, and `server_time` with `display_server_time`. `last_updated` is always null | `results[]` with `title`, `url`, `snippet`, `date` and `last_updated`, plus `id` and `server_time` |
| Errors | Perplexity's `422` body `{"detail": [{"loc", "msg", "type"}]}`. An empty balance answers `402`. A busy call answers `429` with `Retry-After` and charges nothing | Invalid requests, rate limited requests and upstream failures are not billed. An empty balance can return `402` |
| Price per 1,000 searches | $5 for up to 10 results, with page text. 20 results cost $0.011 a call | $5.00 per 1,000 successful requests, and Fast Search $1.00 per 1,000. A reply with no results is billed |
| Calls a minute | Up to 8,800 searches a minute on one account | 50 query units per second, the same on every usage tier |
| Free to start | $10 of credit, no card, which covers 2,000 searches | Prepaid credits, with auto top-up when the balance runs low |

## The Perplexity Search API reference, on SpecStream

### The call, before and after

```
# Before
curl -X POST https://api.perplexity.ai/search \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" -H "Content-Type: application/json" \
  -d '{"query": "Who founded Mistral AI and when?", "max_results": 5}'

# After
curl -X POST https://api.specstream.ai/perplexity/search \
  -H "Authorization: Bearer $SPECSTREAM_API_KEY" -H "Content-Type: application/json" \
  -d '{"query": "Who founded Mistral AI and when?", "max_results": 5}'
```

In the `perplexityai` Python SDK the change is the client line. The SDK also reads `PERPLEXITY_BASE_URL` from the environment.

```
# Before
client = Perplexity(api_key=PERPLEXITY_API_KEY)

# After
client = Perplexity(api_key=SPECSTREAM_API_KEY, base_url="https://api.specstream.ai/perplexity")
```

Every parameter and field on this page is in the [pass table](https://specstream.ai/specstream/dialects/perplexity.md), measured on production on November 10, 2026.

### Apps and SDKs that take the address as a setting

Each line was run on production on November 10, 2026 through that client's own request and reply code. Put your SpecStream key wherever the client takes its key.

Open WebUI: choose the web search engine `perplexity_search` and set Perplexity Search API URL (`PERPLEXITY_SEARCH_API_URL`) to the whole address, `https://api.specstream.ai/perplexity/search`, with your SpecStream key in the engine's key field.

LiteLLM 1.108.4: set `PERPLEXITY_API_BASE` to `https://api.specstream.ai/perplexity` and put your SpecStream key in `PERPLEXITYAI_API_KEY`. The call stays `litellm.search(search_provider="perplexity")`.

LangChain, `langchain-perplexity` 1.4.2: `PerplexitySearchRetriever` has no address argument, so set `PERPLEXITY_BASE_URL` to `https://api.specstream.ai/perplexity` in the environment.

Perplexity's MCP server: set `PERPLEXITY_BASE_URL` to `https://api.specstream.ai/perplexity`, with your SpecStream key where the Perplexity key went.

### Every parameter the route uses

Used in the search: `query` (a string, or a list of one), `max_results` (1 to 20, or up to 50 with `search_type` `people`), `search_type` `people`, `search_domain_filter` with or without a `-` before a domain, `search_recency_filter` (`hour`, `day`, `week`, `month`, `year`), `search_after_date_filter` and `search_before_date_filter`.

Used to shape the reply: `max_tokens_per_page` and `max_tokens` (each token is 4 characters of page text, and a budget for all results is shared out evenly), and `display_server_time`.

Refused with Perplexity's `422`: a `query` list of two or more queries, a `max_results` over 20 on a web search, and a date filter that is not MM/DD/YYYY. A call with no key gets `401`.

### Every field that comes back

The reply has `id`, `results` and `server_time`, which holds the time when you send `display_server_time` and is null otherwise. Each result has `title`, `url`, `snippet`, `date` when the page has a date, and `last_updated`, which is always null.

One field is added: `specstream`, with what the Search API returns beyond Perplexity's fields, including the call's `price_usd`. A parser that reads Perplexity's fields never sees it.

### $5 per 1,000 searches, page text included

A call of up to 10 results costs $0.005, with or without a page text budget. Each started block of 10 more results adds $0.006: 20 results cost $0.011 and a `people` search of 50 costs $0.029. A call stopped by a `429` charges nothing, and credit you buy never expires.

### The most accurate web search API, in about one second

On SimpleQA Verified the SpecStream Search API scores 97.9 F-score on all 1,000 official questions, 978 of them correct. On WideSearch it scores 64.0 item F1 and 43.4 row F1 on all 200 official tasks. The Extract API scores 0.908 F1 on WCXB. Every score and its method is on the [benchmarks](https://specstream.ai/benchmarks?utm_source=alternatives&utm_campaign=migrate-perplexity) page.

A call with no `max_tokens` or `max_tokens_per_page` runs the fast search. Measured on production on November 9, 2026, its median was 0.82 s at 1 search a second and 1.07 s at 20 a second, the 95th percentile stayed between 1.09 and 1.73 s, and it answered 718 of 720. It takes up to 8,800 searches a minute on one account. A call with a page text budget runs the default search, which reads the pages, at the same price.

### You decide what is kept, on each key

Create the key with `zero_retention` and a search made with it keeps no request text and no answer after the reply: it is not in the history, its answer is not reused for another call, and its log lines carry neither. `spend_cap_cents` is the most the key can spend.

```
curl -X POST https://api.specstream.ai/v1/account/keys \
  -H "Authorization: Bearer $SPECSTREAM_API_KEY" -H "Content-Type: application/json" \
  -d '{"name": "production", "scopes": ["account:read", "finds:spend"], "spend_cap_cents": 500000, "zero_retention": true}'
```

### Search, pages and rows on one key

The same key reads up to 20 pages or documents a call with the [Extract API](https://specstream.ai/extract-api?utm_source=alternatives&utm_campaign=migrate-perplexity) at $0.80 per 1,000 pages, and a page with no text is not charged. [Deep Search](https://specstream.ai/deep-search?utm_source=alternatives&utm_campaign=migrate-perplexity) returns every match for a request in plain words as structured rows, at 5¢, 15¢ or $1 a row, with a source URL on every value. The most a run can cost is approved before it starts. The full comparison is on the [Perplexity alternative](https://specstream.ai/alternatives/perplexity-sonar?utm_source=alternatives&utm_campaign=migrate-perplexity) page.

## What else Perplexity Search API users price

### Tavily

A search API sold in credits at $0.008 each pay as you go: a basic search takes 1 credit and an advanced search 2. SpecStream answers Tavily's `POST /search` at `https://api.specstream.ai/tavily` for $0.005, basic or advanced.

### Exa

A search API on Exa's own index, at $7 per 1,000 requests on `auto` and $4 on `lite` for up to 10 results, with its own request and reply. SpecStream answers Exa's call as well, at `https://api.specstream.ai/exa`, for $0.005 a search.

### Brave Search API

A search API on Brave's own index at $5 per 1,000 requests, with $5 in free credits every month and 50 queries per second. SpecStream answers Brave's call at `https://api.specstream.ai/res/v1/web/search` at the same price per call and takes up to 8,800 searches a minute on one account.

## How to migrate, step by step

1. Create a key under Agents & API in the workspace. A new account gets $10 of credit, no card, which covers 2,000 searches.

2. Set the base address to `https://api.specstream.ai/perplexity` where your code has `https://api.perplexity.ai`, and send the SpecStream key as the Bearer token. In Python:

```
import requests

BASE = "https://api.specstream.ai/perplexity"  # was https://api.perplexity.ai

reply = requests.post(
    f"{BASE}/search",
    headers={"Authorization": f"Bearer {SPECSTREAM_KEY}"},
    json={"query": "Who founded Mistral AI and when?", "max_results": 10, "search_recency_filter": "year"},
    timeout=30,
)
reply.raise_for_status()
for result in reply.json()["results"]:
    print(result["title"], result["url"], result["date"])
```

3. In JavaScript:

```
const res = await fetch("https://api.specstream.ai/perplexity/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SPECSTREAM_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "Who founded Mistral AI and when?", max_results: 10 }),
});
const data = await res.json();
for (const result of data.results) console.log(result.title, result.url, result.snippet);
```

4. Read `402` as an empty balance and `429` as a call to send again after `Retry-After`; neither is charged. Send one query per call.

5. When your product needs every match in place of a results page, write the request in plain words. SpecStream reads it back as the conditions every row must meet and the facts to bring back, quotes the most it can cost, and delivers the rows after you approve.

## Frequently asked questions

### Is there a Perplexity Search API compatible API?

Yes. SpecStream answers Perplexity's `POST /search` at `https://api.specstream.ai/perplexity` in Perplexity's JSON, checked on production on November 10, 2026, for $0.005 a search of up to 10 results.

### How do I migrate from the Perplexity Search API?

Change one line: set `base_url` to `https://api.specstream.ai/perplexity` (or `PERPLEXITY_BASE_URL`) and use a SpecStream key. The request body and the code that reads `results[]` stay as they are.

### How much does the Perplexity Search API cost?

Perplexity charges $5.00 per 1,000 successful requests, and Fast Search $1.00 per 1,000, with a reply that has no results billed. SpecStream charges $5 per 1,000 searches of up to 10 results, page text included.

### Which apps and SDKs take the SpecStream address for Perplexity Search API?

Open WebUI: choose the web search engine `perplexity_search` and set Perplexity Search API URL (`PERPLEXITY_SEARCH_API_URL`) to the whole address, `https://api.specstream.ai/perplexity/search`, with your SpecStream key in the engine's key field. LiteLLM 1.108.4: set `PERPLEXITY_API_BASE` to `https://api.specstream.ai/perplexity` and put your SpecStream key in `PERPLEXITYAI_API_KEY`. The call stays `litellm.search(search_provider="perplexity")`. LangChain, `langchain-perplexity` 1.4.2: `PerplexitySearchRetriever` has no address argument, so set `PERPLEXITY_BASE_URL` to `https://api.specstream.ai/perplexity` in the environment. Perplexity's MCP server: set `PERPLEXITY_BASE_URL` to `https://api.specstream.ai/perplexity`, with your SpecStream key where the Perplexity key went.

### Does the perplexityai SDK work with SpecStream?

Yes. The `perplexityai` Python SDK 0.46.1 ran every check in the pass table with `base_url="https://api.specstream.ai/perplexity"` and a SpecStream key, and `client.search.create` reads the reply into its own objects.

### Which Perplexity fields does SpecStream not fill?

One: `last_updated` is always null. Each result has `title`, `url` and `snippet`, `date` when the page has a date, and the reply has `id`, plus `server_time` when you send `display_server_time`.

### Can one call carry several queries?

One query per call. A `query` list of two or more gets a `422` that says so; send each query as its own call, at $0.005 each.

### What happens when search is busy?

The route answers `429` with a `Retry-After` header and charges nothing. One account can send up to 8,800 searches a minute.

## Sources

SpecStream wrote this page. Each Perplexity figure comes from Perplexity's own pages, and each other provider's figure from that company's own page. The route's behavior is taken from its code and from the pass table measured on production on November 10, 2026.

- [Perplexity Search overview](https://docs.perplexity.ai/docs/search/overview.md), read Nov 10, 2026
- [Perplexity Search quickstart](https://docs.perplexity.ai/docs/search/quickstart.md), read Nov 10, 2026
- [Perplexity pricing](https://docs.perplexity.ai/docs/getting-started/pricing.md), read Nov 10, 2026
- [Perplexity FAQ](https://docs.perplexity.ai/docs/resources/faq.md), read Nov 10, 2026
- [Perplexity rate limits](https://docs.perplexity.ai/docs/admin/rate-limits-usage-tiers.md), read Nov 10, 2026
- [SpecStream pass table, Perplexity route](https://specstream.ai/specstream/dialects/perplexity.md), read Nov 10, 2026
- [Tavily API credits](https://docs.tavily.com/documentation/api-credits.md), read Nov 9, 2026
- [Exa pricing](https://exa.ai/docs/admin/pricing.md), read Nov 9, 2026
- [Brave Search API](https://brave.com/search/api/), read Nov 9, 2026
- [SpecStream benchmarks](https://specstream.ai/benchmarks), read Nov 10, 2026
- [SpecStream pricing](https://specstream.ai/pricing), read Nov 10, 2026
- [SpecStream for agents](https://specstream.ai/agents.md), read Nov 10, 2026
