GET

/v1/schemas/perplexity/chat/v1/sonar?kind=output

kind outputactivity chathash a6de4b6d…extracted Oct 3, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
1a269d5596e506d3189e57c3ae84874a21c3532afe8c95de6f21e55f17001f15
{
  "fetchedAt": 1791005478,
  "extractorVersion": "1",
  "verifiedAt": null
}

Response body

10 properties · 4 required · 14 $defs
propertytypedescriptionconstraints
id*stringUnique identifier for the completion
model*stringModel used for generation
created*integerUnix timestamp when the completion was created
choices*Choice[]Array of completion choices
usageUsageInfoToken usage and cost information for a requestnullable
objectstringObject type identifierdefault: "chat.completion"
citationsstring[]URLs of sources used to generate the responsenullable
search_resultsApiPublicSearchResult[]Search results used for context in the responsenullable
imagesImageResult[]Array of images returned when return_images is truenullable
related_questionsstring[]Array of related questions returned when return_related_questions is truenullable

Types

14 $defs

ApiPublicSearchResultobject

A single search result from the web

title*stringTitle of the search result page
url*stringURL of the search result page
datestringPublication date of the resultnullable
last_updatedstringDate the result was last updatednullable
snippetstringText snippet from the search resultdefault: ""
sourceenumSource type of the result (web or attachment)web | attachment · default: "web"

ChatMessage-Outputobject

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

Choiceobject

A single completion choice

index*integerIndex of the choice in the array
finish_reasonenumReason generation stopped (stop or length)stop | length · nullable
message*ChatMessage-OutputComplete message (non-streaming)
delta*ChatMessage-OutputIncremental message delta (streaming)

Costobject

Cost breakdown for a chat completion request

input_tokens_cost*numberCost for input tokens in USD
output_tokens_cost*numberCost for output tokens in USD
reasoning_tokens_costnumberCost for reasoning tokens in USDnullable
request_costnumberCost for web search requests in USD (includes pro search cost if applicable)nullable
citation_tokens_costnumberCost for citation tokens in USDnullable
search_queries_costnumberCost for search queries in USDnullable
total_cost*numberTotal cost for the request in USD

ImageResultobject

A single image search result

image_url*stringURL of the image
origin_url*stringOriginal URL where the image was found
height*integerHeight of the image in pixelsformat: int64
width*integerWidth of the image in pixelsformat: int64
titlestringTitle or description of the image

URLobject

url*string

UsageInfoobject

Token usage and cost information for a request

prompt_tokens*integerNumber of tokens in the prompt/input
completion_tokens*integerNumber of tokens in the completion/output
total_tokens*integerTotal tokens used (prompt + completion)
search_context_sizestringSize of search context usednullable
citation_tokensintegerNumber of tokens used for citationsnullable
num_search_queriesintegerNumber of search queries executednullable
reasoning_tokensintegerNumber of tokens used for reasoningnullable
cost*CostCost breakdown for the request

VideoURLobject

url*string
frame_intervalstring | integerdefault: 25

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", …}]}