curl --request POST \
--url https://api.perplexity.ai/async/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"model": "sonar-deep-research",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
]
}
}
'{
"id": "<string>",
"model": "<string>",
"created_at": 123,
"status": "CREATED",
"started_at": 123,
"completed_at": 123,
"response": {
"id": "<string>",
"model": "<string>",
"created": 123,
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>"
},
"delta": {
"role": "system",
"content": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"total_cost": 123,
"reasoning_tokens_cost": 123,
"request_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123
},
"search_context_size": "<string>",
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123
},
"object": "chat.completion",
"citations": [
"<string>"
],
"search_results": [
{
"title": "<string>",
"url": "<string>",
"date": "<string>",
"last_updated": "<string>",
"snippet": "",
"source": "web"
}
],
"images": [
{
"image_url": "<string>",
"origin_url": "<string>",
"title": "<string>",
"width": 123,
"height": 123
}
],
"related_questions": [
"<string>"
]
},
"failed_at": 123,
"error_message": "<string>"
}Submit an asynchronous chat completion request.
curl --request POST \
--url https://api.perplexity.ai/async/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"model": "sonar-deep-research",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
]
}
}
'{
"id": "<string>",
"model": "<string>",
"created_at": 123,
"status": "CREATED",
"started_at": 123,
"completed_at": 123,
"response": {
"id": "<string>",
"model": "<string>",
"created": 123,
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>"
},
"delta": {
"role": "system",
"content": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"cost": {
"input_tokens_cost": 123,
"output_tokens_cost": 123,
"total_cost": 123,
"reasoning_tokens_cost": 123,
"request_cost": 123,
"citation_tokens_cost": 123,
"search_queries_cost": 123
},
"search_context_size": "<string>",
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123
},
"object": "chat.completion",
"citations": [
"<string>"
],
"search_results": [
{
"title": "<string>",
"url": "<string>",
"date": "<string>",
"last_updated": "<string>",
"snippet": "",
"source": "web"
}
],
"images": [
{
"image_url": "<string>",
"origin_url": "<string>",
"title": "<string>",
"width": 123,
"height": 123
}
],
"related_questions": [
"<string>"
]
},
"failed_at": 123,
"error_message": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Successful Response
Unique identifier for the async request
Model used for the request
Unix timestamp when the request was created
Current processing status of the request
CREATED, IN_PROGRESS, COMPLETED, FAILED Unix timestamp when processing started
Unix timestamp when processing completed
Show child attributes
Unix timestamp when the request failed (if applicable)
Error message if the request failed
Was this page helpful?
Suggestions