DocAI API
PDF to JSON document processing API. REST and MCP reference for intelligent document processing.
DocAI turns business PDFs into structured JSON. This site is the integrator reference for the PDF data extraction API and document processing endpoints.
Base URL
https://docaiapi.subgradientlabs.com/api/v1The same routes are also mounted under /api (alias). Prefer /api/v1.
Interactive OpenAPI (public subset: extract, jobs, usage, schema reads, API keys) lives on the API host at /docs. Machine-readable schema: /api/openapi.json. Org delete, checkout, and connector OAuth are not in that spec.
Quick start
- Create an API key in the DocAI workstation (Settings → API keys).
- Call extract with Bearer auth:
curl -X POST "$API/api/v1/extract" \
-H "Authorization: Bearer docai_sk_live_..." \
-F "file=@invoice.pdf" \
-F "extract_tier=lite"- Check credits with
GET /api/v1/billing/usage.
Contents
| Guide | What you get |
|---|---|
| Authentication | API keys, TTL, rotate, Bearer header, org-scoped JWT |
| Python | pip install doc-ai client (from docai import DocAI) |
| Extract | Sync extract, modes, guidance rules |
| Jobs & batch | Async batch + polling |
| Credits | Burn rates, usage, catalog, checkout |
| Errors | 400 / 401 / 402 / 429 shapes |
| Idempotency | What is safe to retry |
| Connectors | How to use Drive, Gmail, Sheets, Slack, QuickBooks, Shippo |
| MCP | Streamable HTTP tools for agents |
Product UI
For the workstation and marketing site, see docai.subgradientlabs.com.