100% Private
100% Local
No Signups

ExactPDF API v1

Headless PDF tools for AI agents. Same product as exactpdf.com — metered by API credits (20 free per month for new signups; create keys from the Max area). All JSON errors include support@exactpdf.com.

Auth

Authorization: Bearer sk_live_…
or X-API-Key: sk_live_…

GET /api/v1/account

Returns credits remaining and key metadata. Does not consume a credit.

POST /api/v1/merge

multipart/form-data with two or more parts named file (PDF). Returns application/pdf on success. Consumes 1 credit only after a successful merge. Max total upload 20MB; max output 16MB.

POST /api/v1/split

One file (PDF). Default: application/zip with page-001.pdf, … (one PDF per page). Optional at_pages (split after those 1-based pages, e.g. 3,7) or ranges JSON ([[1,3],[4,10]]) for custom segments. 1 credit. Max 150 pages (per-page mode); max 25 segments (range modes); ZIP capped at 48MB.

POST /api/v1/rotate

file (PDF) plus form field angle: 90, 180, 270, -90, -180, or -270 (degrees, applied to every page). Returns application/pdf. 1 credit.

POST /api/v1/compress

One file (PDF). MVP rebuild with object streams — may reduce size for some PDFs; scanned files may not shrink much. Returns application/pdf. 1 credit.

POST /api/v1/images-to-pdf

One or more file parts (PNG or JPEG only), order preserved. Returns application/pdf. 1 credit. Up to 25 images, 30MB total.

POST /api/v1/extract-text

One file (PDF). Returns JSON with text and page_count. 1 credit on success. Max upload 12MB for this endpoint.

POST /api/v1/pdf-info

One file (PDF). Returns JSON with page_count and document metadata (title, author, subject, keywords, producer, creator). 0 credits (does not deduct; still requires a valid API key).

MCP (Cursor / Claude / Codex)

Publishable package @exactpdf/mcp (packages/exactpdf-mcp in this repo). Set EXACTPDF_API_KEY and wire stdio in your MCP client. Tools: exactpdf_account, exactpdf_pdf_info, exactpdf_merge_pdfs, exactpdf_split_pdf, exactpdf_rotate_pdf, exactpdf_compress_pdf, exactpdf_images_to_pdf, exactpdf_extract_text. Optional: EXACTPDF_API_OUTPUT_DIR or EXACTPDF_MERGE_OUTPUT_DIR for saved PDF/ZIP outputs.