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.
Documentation Index
Fetch the complete documentation index at: https://docs.trynia.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
API key must be provided in the Authorization header
Body
Request for the v2 document/agent endpoint.
Question to ask about the document(s)
1 - 10000Data source ID of a single indexed document
List of data source IDs for multi-document queries (max 50)
50JSON Schema for structured output
Model to use (claude-opus-4-7, claude-sonnet-4-5-20250929, etc.)
Enable extended thinking
Token budget for thinking (ignored for adaptive models like Opus 4.7)
1000 <= x <= 50000Stream response as SSE events

