analysis
Analyze Document
Analyze a document by asking questions. Unlike /extract, this endpoint can compute, reason, and derive values that aren't explicitly written in the document.
Upload a file (or provide a URL) along with a typed schema. Each field must have a type and description.
Example schema:
{
"total_cost": {"type": "number", "description": "Sum all line item amounts"},
"is_auto_renew": {"type": "boolean", "description": "Does this contract auto-renew?"},
"risk_level": {"type": "string", "enum": ["low", "medium", "high"], "description": "Legal risk level"}
}
Supported types: string, number, integer, boolean, array, object
Every answer includes:
- The computed answer (type-enforced)
- Reasoning explaining how it was derived
- Source text snippets from the document
- Confidence level
Pricing: 2 credits/page (min 5) for documents, 10 credits for websites.
post/api/v1/analyze
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
- Auth: none declared
Headers
X-API-Keystring
Response
Successful Response
Example response
{
"confidence": {
"is_overdue": 0.72,
"total_cost": 0.95
},
"content_type": "application/pdf",
"credits_used": 10,
"data": {
"is_overdue": true,
"total_cost": 1500
},
"filename": "invoice.pdf",
"model_used": "gpt-5.1",
"reasoning": {
"is_overdue": "Due date 2025-01-15 has passed.",
"total_cost": "Summed 3 line items: $500 + $600 + $400"
},
"sources": {
"is_overdue": [
"Due Date: January 15, 2025"
],
"total_cost": [
"Item A: $500",
"Item B: $600",
"Item C: $400"
]
},
"success": true,
"text_length": 3200,
"total_pages": 5
}Changes
No recorded changes to this operation across all 1 revision of this API.