v1

latestOpenAPI 3.1.02026-07-22168133210.3 KB
Usage

Enqueue an async document agent job

Create a long-running document agent job. Returns immediately with a job_id — use GET /document/agent/jobs/{job_id} to poll for the result or GET /document/agent/jobs/{job_id}/stream for live SSE updates.

Recommended for production workloads, batch evaluation pipelines, or anything that may run longer than ~10 minutes. The job runs on a background worker pool with 30-minute hard timeout, per-user concurrency caps, and automatic refunds on failure.

post/document/agent/jobs

Request body

source_idstring nullable

Data source ID of a single indexed document

source_idsstring[] nullable

List of data source IDs for multi-document queries (max 50)

querystring required

Question to ask about the document(s)

json_schemaobject nullable

JSON Schema for structured output

modelstring

Model to use (claude-opus-4-7, claude-sonnet-4-5-20250929, etc.)

thinking_enabledboolean

Enable extended thinking

thinking_budgetinteger

Token budget for thinking (ignored for adaptive models like Opus 4.7)

streamboolean

Stream response as SSE events

Response

Successful Response

job_idstring required

Workflow run id — pass to GET/stream/cancel endpoints

statusstring required

Initial status — usually 'queued'

created_atstring required
messagestring required