POST /v1/research
Research
Searches, reads and answers with cited sources. fast answers within the request, deep runs in the background, and auto chooses for you.
Request body
- query
- string
- Required.What to search for or research. Non-empty, up to 2,000 characters.
- mode
- string
- fast for a quick answer, deep for in-depth research, auto to choose by query.Default: auto
Response
- id
- string
- Run id, for getting, cancelling or deleting the Run.
- status
- string
- queued, running, completed, failed or cancelled.
- created_
at - string
- When the Run was created.
- started_
at - string | null
- When the Run started; null before then.
- completed_
at - string | null
- When the Run ended; null until then.
- mode
- string
- The mode the Run used: fast or deep.
- message
- string
- A polling hint while the Run is in progress.
- requested_
mode - string
- The mode you requested.
- error.
code - string
- Why the Run failed. Present only when status is failed.
- error.
retryable - boolean
- Whether running the same query again may succeed.
- result.
answer - string
- The answer, once the Run is completed.
- result.
sources - object[]
- Cited sources, each with title and url.
Runs
A fast request waits up to 20 seconds and returns 200 with the finished Run. deep, or a Run still going when the wait ends, returns 202 with its id: get it until status is completed, failed or cancelled. Send Prefer: respond-async to return at once, or Prefer: wait=N to wait at most N seconds.
- Get
GET /v1/research/{id} - The Run as it is now. While it is queued or running, get it again after Retry-After.
- Cancel
POST /v1/research/{id}/cancel - 200 once cancelled, 202 while cancellation finishes. A Run that has already ended returns 409 run_not_cancellable.
- Delete
DELETE /v1/research/{id} - 204 once deleted. 202 while a running Run is stopped and deleted; it then returns 404.
Use the API key that created a Run for every operation on it.
See also: Authentication · Errors · Rate limits