Skip to main content
POST
/
api
/
v1
/
analyze
/
cross
Cross-Document Analysis
curl --request POST \
  --url https://api.example.com/api/v1/analyze/cross \
  --header 'Content-Type: multipart/form-data' \
  --form 'schema=<string>' \
  --form 'urls=<string>' \
  --form 'url_headers=<string>' \
  --form 'document_labels=<string>' \
  --form include_steps=false \
  --form sync=true \
  --form 'webhook_url=<string>'
{
  "confidence": {
    "rates_match": 0.95
  },
  "credits_used": 35,
  "data": {
    "rates_match": false
  },
  "documents": [
    {
      "content_type": "application/pdf",
      "filename": "invoice_042.pdf",
      "label": "invoice",
      "text_length": 1200,
      "total_pages": 2
    },
    {
      "content_type": "application/pdf",
      "filename": "service_agreement.pdf",
      "label": "contract",
      "text_length": 15000,
      "total_pages": 8
    }
  ],
  "model_used": "gpt-5.1",
  "reasoning": {
    "rates_match": "Invoice hourly rate ($150) differs from contract rate ($125)"
  },
  "sources": {
    "rates_match": [
      "[invoice] \"Rate: $150.00/hr\"",
      "[contract] \"Hourly rate: $125.00\""
    ]
  },
  "success": true,
  "total_pages": 10,
  "total_text_length": 16200
}

Headers

X-API-Key
string

Body

multipart/form-data
schema
string
required

JSON schema — keys are field names, values describe what to validate or compute across documents

files
string[]

Files to analyze (2-5). Labeled by filename or via document_labels.

urls
string | null

JSON array of URLs, or JSON object mapping labels to URLs (e.g. {"invoice": "https://..."}). Combined with files, total must be 2-5.

url_headers
string | null

JSON-encoded headers for URL auth

document_labels
string | null

JSON array of labels for the uploaded files, in order. Must match files count. E.g. ["invoice", "contract"]

include_steps
boolean
default:false

Include the agent's reasoning trace 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 cross-document analysis — flat parallel dicts matching /extract.

data
Data · object
required

Computed/derived values keyed by field name

documents
DocumentInfo · object[]
required

Metadata for each document in the analysis

model_used
string
required

Model used for analysis

total_text_length
integer
required

Combined text length across all documents

total_pages
integer
required

Combined page count across all documents

success
boolean
default:true
confidence
Confidence · object

Per-field confidence scores (0.0–1.0)

sources
Sources · object

Per-field source text snippets (prefixed with [doc_label])

reasoning
Reasoning · object

Per-field step-by-step explanation referencing specific documents

steps
Steps · object

Per-field agent reasoning trace. Empty unless include_steps=true.

credits_used
integer
default:0

Credits consumed

schema_format
enum<string> | null

Schema format: always 'typed'

Available options:
typed