v1

latestOpenAPI 3.1.02026-07-22168133210.3 KB
Usage

Query document(s) with an AI agent (synchronous)

Run the full document agent against one or more indexed PDFs or documents. The agent uses tools (search, read sections, read pages) to research the document(s) and produce a comprehensive answer with citations. Supports optional structured output via json_schema.

This endpoint is synchronous and holds the HTTP connection for the entire agent run (typically 1-10 minutes). For production workloads or anything that may run longer, use POST /document/agent/jobs instead — it returns a job_id immediately and lets you poll or stream results without an HTTP connection limit.

post/document/agent

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

answerstring required
{"stackTrail":"components:schemas:DocumentQueryResponse:properties:structured_output:anyOf","oasType":"schema","type":"unknown","title":"Structured Output","nullable":true}
modelstring required
usageobject nullable