Document Intelligence & PDF Engine for Agents and Developers
High-speed vector transformations, forensic redaction, structured data extraction, and pre-send quality audits via REST APIs, Model Context Protocol (MCP), and Autonomous Agent protocols.
1. Authentication
Pass your API key in every request using the Authorization or X-API-Key header:
Authorization: Bearer doclium_sk_live_...
X-API-Key: doclium_sk_live_...
Don't have a key? Go to the API Keys Dashboard to mint one in 1 click.
2. cURL Example — Extract Data
Extract structured invoice or bank statement rows:
curl -X POST https://doclium.com/api/v1/pdf/extract-data \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]"
Python Quickstart
import requests
API_KEY = "doclium_sk_live_YOUR_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
# 1. Run Doclium Ready Quality Audit
with open("contract.pdf", "rb") as f:
resp = requests.post(
"https://doclium.com/api/v1/pdf/check",
headers=headers,
files={"file": f},
params={"intent": "sign"}
)
print("Ready to Sign:", resp.json()["ready"])
print("Findings:", resp.json()["findings"])
# 2. Extract structured totals and dates
with open("invoice.pdf", "rb") as f:
data = requests.post(
"https://doclium.com/api/v1/pdf/extract-data",
headers=headers,
files={"file": f}
).json()
for field in data.get("fields", []):
print(f"{field['label']}: {field['value']} (Page {field['page']})")
API Keys Management
API keys allow programmatic access to Doclium REST endpoints and MCP server. Secret keys are hashed with SHA-256 and only shown once.
Model Context Protocol (MCP) Integration
Doclium implements the open Model Context Protocol (JSON-RPC 2.0). Connect Claude Desktop, Cursor, or Antigravity to empower LLMs with direct PDF transformations and structured document parsing.
Claude Desktop Configuration
Add this to your ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):
{
"mcpServers": {
"doclium": {
"command": "python3",
"args": ["-m", "server.mcp_server"],
"cwd": "/path/to/Doclium"
}
}
}
Running this way, every tool's document_id is a path to a PDF on your own machine — Claude Desktop is running locally, so a local file is what it can read. Give it an absolute path (e.g. /Users/you/statement.pdf).
Exposed MCP Tools
doclium_merge_pdf: Merge multiple PDF documents into one.doclium_split_pdf: Extract page ranges or pull out specific pages.doclium_compress_pdf: Reduce PDF size while keeping text sharp.doclium_extract_data: Extract structured financial tables, totals, and dates.doclium_check_document: Run Doclium Ready pre-send audit (PII, signatures, math).doclium_redact_pdf: Byte-level character removal for court or privacy sanitization.doclium_export_markdown: Convert PDF into clean Markdown with heading hierarchy.
Tools that produce a new PDF (merge, split, compress, redact) write it next to the source file and return that path, alongside the file's contents as base64.
Over HTTP (agents, not a desktop app)
POST /mcp speaks the same JSON-RPC 2.0, authenticated with an API key (X-API-Key or Authorization: Bearer). Here document_id is not a path — it's the id returned by POST /documents after you upload a PDF to your account, since a hosted server has no access to a remote agent's filesystem. Upload first, then pass the returned id to any tool above.
AI Agent Protocols & Discovery
Doclium provides machine-readable manifests so autonomous AI agents can self-discover and bind document tools at runtime.
Agent Discovery Endpoint
For LangChain, AutoGPT, and Antigravity:
GET /.well-known/agent.json
OpenAPI 3.1 Schema
For ChatGPT Custom Actions & Swagger:
GET /api/v1/openapi.json
LangChain Tool Example
from langchain_core.tools import tool
import requests
@tool
def audit_pdf(file_path: str, intent: str = "sign") -> dict:
"""Audit a PDF document before signing or sending using Doclium Ready."""
with open(file_path, "rb") as f:
resp = requests.post(
"https://doclium.com/api/v1/pdf/check",
headers={"Authorization": "Bearer doclium_sk_live_..."},
files={"file": f},
params={"intent": intent}
)
return resp.json()
/api/v1/pdf/extract-dataExtract structured totals, VAT/tax, dates, invoice numbers, and account details.
curl -X POST https://doclium.com/api/v1/pdf/extract-data \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]"
/api/v1/pdf/checkRun deterministic Doclium Ready pre-send audit (intents: send, sign, pay, submit, file, all).
curl -X POST "https://doclium.com/api/v1/pdf/check?intent=all" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]"
/api/v1/pdf/compressCompress a PDF file while preserving visual clarity.
curl -X POST https://doclium.com/api/v1/pdf/compress \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
--output compressed.pdf
/api/v1/pdf/mergeCombine multiple PDFs into a single downloadable PDF.
curl -X POST https://doclium.com/api/v1/pdf/merge \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "[email protected]" \
--output merged.pdf
/api/v1/pdf/redactPermanently delete sensitive terms (comma-separated).
curl -X POST https://doclium.com/api/v1/pdf/redact \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "terms=Confidential,4000-1234-5678" \
--output redacted.pdf
Interactive API Sandbox
Test Doclium APIs directly from your browser.