# Perplexity Search API clients against SpecStream

Date: 2026-11-10. Client: perplexityai (Python) 0.46.1.

## The one line a user changes

Before:

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

After:

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

## Request parameters

Honoured means the check in the Measured column passed on the reply. Accepted, not applied means status 200 and the reply is the search the call runs without the parameter. Refused means the vendor's error status and body.

Counts: 13 honoured, 4 refused, 7 accepted, not applied.

| Parameter | Sent | Verdict | Measured |
|---|---|---|---|
| `query (string)` | `history of the printing press` | honoured | status 200; 10 results |
| `max_results (not sent)` | absent | honoured | status 200; 10 results |
| `query (list of one)` | a list of one query | honoured | status 200; the search ran `history of the printing press inventor` |
| `query (list of two)` | a list of two queries | refused | status 422; [{'loc': ['body'], 'msg': 'Send one query per call: this route runs one search for each call.', 'type': 'unsupported_que |
| `max_results` | `3` | honoured | status 200; 3 results |
| `max_results (over 20, web)` | `21` | refused | status 422; Perplexity's 422 validation body |
| `search_type (people)` | `people` with `max_results=30` | honoured | status 200; 30 results |
| `search_type (fast)` | `fast` | accepted, not applied | status 200; the same search as web |
| `search_domain_filter` | `["wikipedia.org"]` | honoured | status 200; 10 of 10 on wikipedia.org |
| `search_domain_filter (a - before a domain)` | `["-wikipedia.org"]` | honoured | status 200; 10 of 10 off wikipedia.org |
| `search_recency_filter` | `week` | honoured | status 200; the search ran `history of the printing press Korea after:2026-11-03` |
| `search_after_date_filter` | `01/01/2025` | honoured | status 200; the search ran `history of the printing press China after:2025-01-01` |
| `search_before_date_filter` | `01/01/2020` | honoured | status 200; the search ran `history of the printing press England before:2020-01-01` |
| `search_after_date_filter (not MM/DD/YYYY)` | `2025-01-01` | refused | status 422; Perplexity's 422 validation body |
| `max_tokens_per_page` | `40` | honoured | status 200; longest snippet 160 characters (40 tokens are 160) |
| `max_tokens` | `100` | honoured | status 200; 400 characters of page text in all (100 tokens are 400) |
| `display_server_time` | `true` | honoured | status 200; server_time 2026-11-10T07:22:52+00:00 |
| `country` | `US` | accepted, not applied | status 200; the search ran `history of the printing press France` |
| `search_language_filter` | `['en']` | accepted, not applied | status 200; the search ran `history of the printing press Italy` |
| `last_updated_after_filter` | `01/01/2025` | accepted, not applied | status 200; the search ran `history of the printing press Spain` |
| `last_updated_before_filter` | `01/01/2026` | accepted, not applied | status 200; the search ran `history of the printing press Netherlands` |
| `search_mode` | `academic` | accepted, not applied | status 200; the search ran `history of the printing press Germany` |
| `search_context_size` | `high` | accepted, not applied | status 200; the search ran `history of the printing press Japan` |
| `Authorization (no key)` | absent | refused | status 401; body {"error": {"message": "Missing API key. Send your SpecStream API key in an Authorization: Bearer header. Get a key at ht |

## Response fields

Present means the field holds a value in every reply or result read; present in n of m counts the results that hold one; absent means the reply leaves it out or sends null.

Counts: 7 present, 1 absent.

| Field | State |
|---|---|
| `id` | present |
| `server_time` | present in 1 of 19 |
| `results` | present |
| `results[].title` | present |
| `results[].url` | present |
| `results[].snippet` | present |
| `results[].date` | present in 74 of 203 |
| `results[].last_updated` | absent |
