Skip to main content
POST
/
async
/
chat
/
completions
Create Async Chat Completion
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>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for creating an asynchronous chat completion

request
ApiChatCompletionsRequest · object
required

The chat completion request to execute asynchronously

idempotency_key
string | null

Unique key to prevent duplicate requests

Response

Successful Response

id
string
required

Unique identifier for the async request

model
string
required

Model used for the request

created_at
integer
required

Unix timestamp when the request was created

status
enum<string>
required

Current processing status of the request

Available options:
CREATED,
IN_PROGRESS,
COMPLETED,
FAILED
started_at
integer | null

Unix timestamp when processing started

completed_at
integer | null

Unix timestamp when processing completed

response
CompletionResponse · object
failed_at
integer | null

Unix timestamp when the request failed (if applicable)

error_message
string | null

Error message if the request failed