Introduction
Perplexity Sonar web-grounded chat endpoint: 127,000-token context, up to 8,000 output tokens, image_url vision input, four reasoning levels, and structured JSON output.
| Field | Value |
|---|---|
| Input | Text |
| Output | Text |
| Input budget | 127,000 tokens |
| max_tokens ceiling | 8,000 |
| Inputs | text / images |
Key features & highlights
Current answers backed by live search
Perplexity Sonar retrieves fresh web context automatically before answering, reducing stale-cutoff gaps for news, product docs, pricing changes, and public filings.
127K input window with focused 8K replies
Combine your internal context or reference notes with live search inside a 127,000-token window while keeping answers concise and responsive up to 8,000 tokens.
Inspect images and return structured records
Pass image_url parts alongside search questions and use response_format to obtain structured JSON summaries ready for downstream dashboards or pipelines.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | Ordered conversation history for Perplexity Sonar (up to 256 messages) supporting text and |
max_tokens | No | Maximum combined thinking and visible reply tokens for Perplexity Sonar (1 to 8,000, default 4,096). |
reasoning_effort | No | Reasoning depth for Perplexity Sonar: none, low, medium, high (default medium), where higher effort uses more output tokens and latency. |
stop | No | One stop sequence or up to four strings (32 characters each) that halt Perplexity Sonar output. at least 1 characters · at least 1 items · at most 4 items |
temperature | No | Sampling temperature for Perplexity Sonar from 0 to 2, where lower values yield steadier wording. |
top_p | No | Nucleus sampling threshold for Perplexity Sonar from 0.01 to 1, tuned independently from temperature. |
response_format | No | Request plain text or structured JSON output from Perplexity Sonar, validating returned JSON in your application. |
Pricing
Input $0.2125 / Output $2.125 per 1 million tokens
Use cases
Competitive and release monitoring
Track new software releases, changelog updates, or regulatory announcements and output dated bullet summaries for product teams.
Customer and analyst research briefs
Combine a company profile or internal memo with live web lookup to produce concise background briefs with clear dates.
Fact-checked content pipelines
Verify public statistics, documentation URLs, or technical specifications in structured JSON before publishing.
Prompt guide & pro tips
Ask specific, time-bounded questions
State the entity, timeframe, and jurisdiction explicitly so web retrieval focuses on authoritative sources instead of broad overviews.
Match the reasoning level to query depth
Use none or low for quick lookups and medium or high when synthesizing conflicting web reports into a single structured brief.
Validate structured outputs before storing
When using
response_formatfor JSON extraction, verify dates and numerical fields in your application before writing to a database.
Overview
Perplexity Sonar web-grounded chat endpoint: 127,000-token context, up to 8,000 output tokens, image_url vision input, four reasoning levels, and structured JSON output.
Limits and billing
Perplexity Sonar accepts up to 127,000 input tokens and 8,000 output tokens (default 4,096), billed per measured token at the live rates on this page.
perplexity/sonar/chat
SpicyAPI adds no filter to Perplexity Sonar; live checks passed romantic, sensual, direct/system nudity, and system-framed BDSM, softened graphic horror with content warnings, and refused or softened all explicit erotica prompts.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "perplexity/sonar/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.



