PDF extraction API · x402 payments
A minimal HTTP API built for AI agents and developers. Send a PDF URL, receive structured markdown. Pay $0.001 per page via USDC — no accounts, no subscriptions, no friction.
How it works
Call /probe with any PDF URL. Get back the page count and exact cost before committing a payment.
Send a POST to /extract. The x402 protocol handles micropayment settlement in USDC on Base — no API keys required.
Get clean, structured markdown back. Headings, lists, and paragraphs are detected automatically from the PDF's layout.
No subscriptions, no sessions, no credential management. Any agent with a Base wallet can call docpull autonomously.
API reference
Base URL: https://docpull.ai
// Response { "status": "ok", "service": "docpull", "version": "1.0.0" }
// Query params ?url=https://example.com/document.pdf // Response { "pageCount": 12, "costUSDC": "0.012000", "pricePerPage": "0.001 USDC" }
// Request body { "url": "https://example.com/document.pdf" } // Without payment → 402 Payment Required { "x402Version": 1, "error": "Payment required", "accepts": [{ "scheme": "exact", "network": "base", ... }] } // With x402 payment → 200 OK { "success": true, "pageCount": 12, "charCount": 18432, "markdown": "# Title\n\n## Section..." }
// Using x402-fetch (agent client) import { wrapFetchWithPayment } from "x402-fetch"; import { createWalletClient } from "viem"; const wallet = createWalletClient({ ... }); // Base wallet const fetch402 = wrapFetchWithPayment(fetch, wallet); const res = await fetch402("https://docpull.ai/extract", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://example.com/doc.pdf" }), }); const { markdown, pageCount } = await res.json();
Pricing
No subscriptions. No minimums. USDC on Base settles instantly via x402 — no accounts needed.
Per-page pricing
per page extracted
How x402 works
The x402 protocol uses the HTTP 402 status code to request payment. Your agent receives the payment requirements, settles USDC on Base, and retries the request — all automatically with an x402-compatible client.
Testnet available
Use Base Sepolia to test your integration before going to mainnet. Set network=base-sepolia in your client config.