analysis

Cross-Document Analysis

Analyze and cross-reference multiple documents together. Unlike /analyze (single document) or /analyze/batch (many documents independently), this endpoint lets the agent reason across all documents simultaneously.

Use cases:

  • Validate an invoice against a contract or purchase order
  • Check that a report's numbers match a source spreadsheet
  • Compare terms across multiple agreements
  • Reconcile data from different sources

Upload 2-5 files and/or provide URLs. Each document gets a label (auto-generated from filename, or you can provide custom labels). The agent can search, read, and compare data across all documents.

Provide a typed schema — each field has a type and description.

Example:

{
  "rates_match": {"type": "boolean", "description": "Do the hourly rates on the invoice match the contract?"},
  "total_valid": {"type": "boolean", "description": "Does the invoice total equal the sum of line items?"},
  "correct_vendor": {"type": "boolean", "description": "Is the vendor name on the invoice the same as the contracting party?"}
}

Pricing: 5 credits/document + 3 credits/page (minimum 10).

post/api/v1/analyze/cross

Request

  • Base URL: https://docs.thedrive.ai (the document declares no server; this is the origin it was published from)
  • URL: https://docs.thedrive.ai/api/v1/analyze/cross
  • Auth: none declared

Headers

X-API-Keystring

Response

Successful Response

successboolean
dataobject required

Computed/derived values keyed by field name

confidenceobject

Per-field confidence scores (0.0–1.0)

sourcesobject

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

reasoningobject

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

stepsobject

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

model_usedstring required

Model used for analysis

total_text_lengthinteger required

Combined text length across all documents

total_pagesinteger required

Combined page count across all documents

credits_usedinteger

Credits consumed

schema_format'typed'

Schema format used for extraction/analysis.

Example response

{
  "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
}

Changes

No recorded changes to this operation across all 1 revision of this API.