curl --request GET \
--url https://api.perplexity.ai/async/chat/completions/{request_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"model": "<string>",
"created_at": 123,
"status": "CREATED",
"started_at": 123,
"completed_at": 123,
"response": {
"id": "<string>",
"model": "<string>",
"created": 123,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"search_context_size": "<string>",
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123
},
"object": "chat.completion",
"choices": [
{
"index": 123,
"message": {
"content": "<string>",
"role": "system"
},
"finish_reason": "stop"
}
],
"search_results": [
{
"title": "<string>",
"url": "<string>",
"date": "2023-12-25"
}
],
"videos": [
{
"url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_width": 123,
"thumbnail_height": 123,
"duration": 123
}
]
},
"failed_at": 123,
"error_message": "<string>"
}Retrieves the status and result of a specific asynchronous chat completion job.
curl --request GET \
--url https://api.perplexity.ai/async/chat/completions/{request_id} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"model": "<string>",
"created_at": 123,
"status": "CREATED",
"started_at": 123,
"completed_at": 123,
"response": {
"id": "<string>",
"model": "<string>",
"created": 123,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"search_context_size": "<string>",
"citation_tokens": 123,
"num_search_queries": 123,
"reasoning_tokens": 123
},
"object": "chat.completion",
"choices": [
{
"index": 123,
"message": {
"content": "<string>",
"role": "system"
},
"finish_reason": "stop"
}
],
"search_results": [
{
"title": "<string>",
"url": "<string>",
"date": "2023-12-25"
}
],
"videos": [
{
"url": "<string>",
"thumbnail_url": "<string>",
"thumbnail_width": 123,
"thumbnail_height": 123,
"duration": 123
}
]
},
"failed_at": 123,
"error_message": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the asynchronous chat completion request.
Successfully retrieved async chat completion response.
Unique identifier for the asynchronous job.
The model used for the request.
Unix timestamp of when the job was created.
The status of an asynchronous processing job.
CREATED, IN_PROGRESS, COMPLETED, FAILED Unix timestamp of when processing started.
Unix timestamp of when processing completed.
The actual chat completion response, available when status is COMPLETED.
Show child attributes
A unique identifier for the chat completion.
The model that generated the response.
The Unix timestamp (in seconds) of when the chat completion was created.
Show child attributes
The type of object, which is always chat.completion.
A list of chat completion choices. Can be more than one if n is greater than 1.
Show child attributes
Show child attributes
stop, length A list of video results when media_response.overrides.return_videos is enabled. Contains video URLs and metadata.
Show child attributes
The URL of the video.
The URL of the video thumbnail image.
The width of the thumbnail image in pixels.
The height of the thumbnail image in pixels.
The duration of the video in seconds.
Unix timestamp of when processing failed.
Error message if the job failed.
Was this page helpful?