Doc API
๐Ÿค–Agentic-first PDF API

HTML to PDF API for developers and AI agents

Generate pixel-perfect PDFs from HTML and CSS โ€” powered by headless Chromium. Full support for Flexbox, Grid, and web fonts. Register programmatically, pay with USDC, monitor credits per-response.

Humans: 100 calls/month free. AI agents: 10 free calls via POST /api/register. No credit card required.

Headless ChromiumFlexbox & GridWeb FontsTailwind CSSprintBackground

Unlike Dompdf, mPDF, and WeasyPrint โ€” no CSS subset restrictions. If it renders in Chrome, it renders in your PDF.

request.js
// Generate a PDF from HTML
const response = await fetch("https://api.docapi.co/v1/pdf", {
  method: "POST",
  headers: {
    "x-api-key": "pk_live_xxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    html: "<h1>Hello World</h1>",
  }),
});
Response: PDF file (application/pdf)
~10ms
Cold start
4 lines
To generate a PDF
43+
Agent integrations
100%
Chrome CSS support

Why developers switch from Puppeteer

Same Chromium rendering. None of the infrastructure.

PuppeteerDoc API
Cold start3โ€“5 seconds~10 ms
Binary size150 MB+0 MB (API call)
Lambda/Vercel setupCustom layers, DockerWorks out of the box
Memory leaksCommon under loadNot your problem
CSS supportFull (you manage it)Full (we manage it)
Integration code50+ lines3 lines

Same headless Chromium under the hood โ€” without the ops burden.

Simple integration

Get started in minutes with your favorite language

curl -X POST https://api.docapi.co/v1/pdf \
-H "x-api-key: pk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello World</h1>"}' \
--output document.pdf
โ†’ Returns PDF file (application/pdf)
Built for AI agents

Your agent registers. Your software runs forever.

One POST request gives an agent everything it needs to build self-funding PDF generation into the software it's building. No dashboards, no credit cards, no human in the loop.

โšก Key differentiator

Native MCP Server โ€” the only PDF API listed on every major MCP registry

Add one block to your config and Claude, Cursor, or Windsurf can generate PDFs directly. No code required.

"url": "https://mcp.docapi.co/mcp"

Works with

๐Ÿค–Claude DesktopโŒจ๏ธCursor๐Ÿ’ปVS Code๐Ÿ„Windsurf๐Ÿ”ŒAny MCP client

The Agent Skill โ€” works with 43+ agents

Claude Code, GPT, Gemini, Cursor, and more. Install once and your agent can register, generate PDFs, and manage USDC credits without writing any integration code.

npx skills add docapi

Register via API, no browser

POST /api/register returns an API key and USDC address in one response. No email confirmation, no dashboard, no human step required.

Pay with USDC on Base

Agents don't have credit cards โ€” they have crypto wallets. Send USDC to your dedicated address on Base mainnet. Credits appear in seconds via webhook. 50 credits per 1 USDC ($0.02/call).

X-Credits-Remaining on every response

Every API response includes a credit balance header. Software watches this header and sends USDC proactively when it drops below 50. The 402 never happens.

10 free calls on registration

Test the API before committing to payment setup. Enough to validate output quality and integration correctness โ€” then fund and go.

POST /api/register โ†’ 201
{
  "api_key": "pk_4a7f2b9c...",
  "usdc_address": "0x2B984ee1...",
  "free_calls": 10,
  "credits_per_usdc": 50,
  "network": "base-mainnet",
  "rate": "$0.02 per API call",
  "auto_topup": {
    "header": "X-Credits-Remaining",
    "recommended_threshold": 50,
    "recommended_topup_usdc": 10
  },
  "on_exhausted": {
    "http_status": 402,
    "body": { "error": "credits_exhausted" }
  },
  "integration": {
    // Python + JS snippets with topup loop
  }
}
Everything the agent needs to self-manage billing

See it in action

An agent self-registers, generates invoices, hits a 402, tops up autonomously with USDC, and resumes โ€” no human in the loop.

Simple, transparent pricing

Start free, scale as you grow

Free
$0/month
  • 100 API calls/month
  • Community support
  • Basic documentation
Most Popular
Starter
$19/month
  • 1,000 API calls/month
  • Email support
  • Full documentation
  • Webhooks
Pro
$49/month
  • 5,000 API calls/month
  • Priority support
  • Full documentation
  • Webhooks
  • Custom fonts
Business
$99/month
  • 20,000 API calls/month
  • Dedicated support
  • Full documentation
  • Webhooks
  • Custom fonts
  • SLA guarantee
AI Agent plan

Pay-per-use with USDC

For AI agents that register and pay programmatically. No monthly commitment, no credit card. Register via POST /api/register, pay with USDC on Base, and get X-Credits-Remaining on every response so your software tops up automatically.

  • 10 free calls on registration
  • 50 credits per 1 USDC
  • No monthly commitment
  • Self-managing credit topup
  • Dedicated USDC wallet address
  • Optional low-balance email alert
$0.02
per API call
1 USDC = 50 credits
Read agent docs

Base mainnet ยท No signup

Frequently asked questions

How reliable is the API?+

Doc API runs on managed infrastructure with automatic scaling. You get the same headless Chromium rendering as Puppeteer โ€” without managing the process yourself. If a render fails, retry it. There's no browser to crash or leak memory on your side.

How fast is PDF generation?+

Cold start is roughly 10ms (vs. 3โ€“5 seconds with self-hosted Puppeteer). Actual render time depends on your HTML complexity, but most documents generate in under 2 seconds end-to-end.

Can I use this in production?+

Yes. The Pro and Business plans include priority and dedicated support respectively, plus SLA guarantees on Business. The Free tier is great for prototyping โ€” upgrade when you're ready to ship.

Do I need to use USDC / crypto?+

No. Human plans use standard monthly billing via Stripe. The USDC payment option exists specifically for AI agents that can't use credit cards. Pick whichever model fits your use case.

What CSS features are supported?+

Everything Chrome supports โ€” Flexbox, Grid, web fonts, Tailwind CSS, media queries, print stylesheets. If it renders in Chrome, it renders in your PDF.

What happens if I exceed my plan limit?+

API calls beyond your monthly limit return a 429 status. You can upgrade your plan anytime from the dashboard, or switch to the agent pay-per-use model for overflow.