Skip to main content
POST
Analyze Document

Headers

X-API-Key
string

Body

multipart/form-data
schema
string
required

JSON schema — keys are field names, values describe what to compute or answer

file
string | null

File to analyze

url
string | null

URL to fetch file from

url_headers
string | null

JSON-encoded headers for URL auth

include_steps
boolean
default:false

Include the agent's reasoning trace (tool calls) in each answer

sync
boolean
default:true

Set to false to process asynchronously. Returns a task_id to poll.

webhook_url
string | null

URL to POST the result to when async processing completes.

Response

Successful Response

Response for document analysis — flat parallel dicts matching /extract.

data
Data · object
required

Computed/derived values keyed by field name

filename
string
required

Original filename or URL

model_used
string
required

Model used for analysis

text_length
integer
required

Length of extracted text

success
boolean
default:true
confidence
Confidence · object

Per-field confidence scores (0.0–1.0)

sources
Sources · object

Per-field source text snippets from the document

reasoning
Reasoning · object

Per-field step-by-step explanation of how the answer was derived

steps
Steps · object

Per-field agent reasoning trace (tool calls). Empty unless include_steps=true.

content_type
string | null

Detected MIME type

total_pages
integer
default:0

Total pages in the document (0 for non-paginated files)

credits_used
integer
default:0

Credits consumed

schema_format
enum<string> | null

Schema format: always 'typed'

Available options:
typed