sonar-deep-research⁠ requests randomly stopping mid-run

Has anyone seen ‎⁠sonar-deep-research⁠ requests randomly stopping mid-run? For example, incomplete responses, early termination, or errors during long deep-research calls. I’m trying to understand if this is an issue with my integration or a recent change on the API side.

Hey @Eric-Geek — this is a known pattern with sonar-deep-research. Because deep research queries can run for several minutes, synchronous requests are prone to timeouts and early termination.

The recommended approach is to use async mode via the /v1/async/sonar endpoint:

# 1. Submit the deep research request
curl -X POST https://api.perplexity.ai/v1/async/sonar \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "sonar-deep-research", "messages": [{"role": "user", "content": "Your research query here"}]}'

# 2. Poll for results using the returned request_id
curl https://api.perplexity.ai/v1/async/sonar/$REQUEST_ID \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY"

Async mode decouples the request from the HTTP connection, so there is no risk of connection timeouts killing the research mid-run. You submit the request, get back a request_id, and poll for the result when it is ready.

See the async deep research docs for the full reference.

Alternatively, if you are using the Agent API, the deep-research preset also handles this — and you can use streaming (stream: true) to keep the connection alive while the research runs.