GET

/v1/schemas/perplexity/chat/v1/sonar

kind inputactivity chathash 71680f3f…extracted Aug 15, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
95305c44ed99cf4e51463de55994b3bd26063194b78668d5e8753534ee3551ab
{
  "fetchedAt": 1786772001,
  "extractorVersion": "1",
  "verifiedAt": null
}

Request body

26 properties · 2 required · 14 $defs
propertytypedescriptionconstraints
model*enumModel to use, for example, sonar-prosonar | sonar-pro | sonar-deep-research | sonar-reasoning-pro
messages*ChatMessage-Input[]Array of messages forming the conversation history
max_tokensintegerMaximum number of completion tokens to generate0 < n ≤ 128000 · nullable
streambooleanIf true, returns streaming SSE responsenullable
stopstring | string[]Stop sequences. Generation stops when one of these strings is producednullable
temperaturenumberControls randomness in the response. Higher values make output more random. Range: 0-20 ≤ n ≤ 2 · nullable
top_pnumberNucleus sampling parameter. Controls diversity via nucleus sampling0 ≤ n ≤ 1 · nullable
response_formatResponseFormatText | ResponseFormatJSONSchemaOptional. Controls the output format. Omit for default text output. Set `type` to `json_schema` for structured output.nullable
web_search_optionsWebSearchOptionsConfiguration options for web search behavior
search_modeenumSource of search results (web, academic, or sec)web | academic | sec · nullable
return_imagesbooleanWhen true, include image results in the responsenullable
return_related_questionsbooleanWhen true, generates suggested follow-up queries based on the search resultsnullable
enable_search_classifierbooleanWhen true, uses a classifier to determine if web search is needed for the querynullable
disable_searchbooleanWhen true, disables all web search capabilities. The model responds based solely on its training datanullable
search_domain_filterstring[]Limit search results to specific domains (e.g. github.com, wikipedia.org)nullable
search_language_filterstring[]Filter results by language using ISO 639-1 codes (e.g. en, fr, de)nullable
search_recency_filterenumFilter by publication recency (hour, day, week, month, or year)hour | day | week | month | year · nullable
search_after_date_filterstringReturn results published after this date (MM/DD/YYYY)nullable
search_before_date_filterstringReturn results published before this date (MM/DD/YYYY)nullable
last_updated_before_filterstringReturn results last updated before this date (MM/DD/YYYY)nullable
last_updated_after_filterstringReturn results last updated after this date (MM/DD/YYYY)nullable
image_format_filterstring[]Filter image results by format (e.g. png, jpg)nullable
image_domain_filterstring[]Limit image results to specific domainsnullable
stream_modeenumControls the format of streaming events. 'full' suppresses reasoning events and includes metadata inline; 'concise' emits reasoning events separatelyfull | concise · default: "full"
reasoning_effortenumControls how much effort the model spends on reasoningminimal | low | medium | high · nullable
language_preferencestringISO 639-1 language code for preferred response languagenullable

Types

14 $defs

ChatMessage-Inputobject

role*enumChat roles enumsystem | user | assistant | tool
content*string | ChatMessageContentTextChunk | ChatMessageContentImageChunk | ChatMessageContentFileChunk[]nullable

ChatMessageContentFileChunkobject

type*const"file_url"
file_url*URL | string
file_namestringnullable

ChatMessageContentImageChunkobject

type*const"image_url"
image_url*URL | string

ChatMessageContentPDFChunkobject

type*const"pdf_url"
pdf_url*URL | string

ChatMessageContentTextChunkobject

type*const"text"
text*string

ChatMessageContentVideoChunkobject

type*const"video_url"
video_url*VideoURL | string

ChatMessageRoleenum

Chat roles enum

system | user | assistant | tool

JSONSchemaobject

schema*object
namestringnullable
descriptionstringnullable
strictbooleannullable

ResponseFormatJSONSchemaobject

Constrains the model output to match the provided JSON schema.

type*constMust be `json_schema`."json_schema"
json_schema*JSONSchema

ResponseFormatTextobject

type*constMust be `text`."text"

URLobject

url*string

UserLocationobject

User's geographic location for search personalization

latitudenumberLatitude coordinatenullable
longitudenumberLongitude coordinatenullable
countrystringISO 3166-1 alpha-2 country codenullable
citystringCity namenullable
regionstringState or region namenullable

VideoURLobject

url*string
frame_intervalstring | integerdefault: 25

WebSearchOptionsobject

Configuration options for web search behavior

search_context_sizeenumAmount of search context to include (low, medium, or high)low | medium | high · default: "low"
search_typeenumSearch type (fast for speed, pro for quality, auto to let the model decide)fast | pro | auto · nullable
user_locationUserLocationUser's geographic location for search personalizationnullable
image_results_enhanced_relevancebooleanWhen true, applies enhanced relevance filtering to image resultsdefault: false

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"perplexity","endpointId":"v1/sonar","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}