# PagePenny > PagePenny is an API that renders PDFs and images (PNG, JPEG, WebP) from starter templates or your own HTML. 1 cent per render: 100 free renders a month, then $5/month including 500 renders, with a spend cap you set. Base URL: https://api.pagepenny.com. It is also a remote MCP server for AI agents. JSON in, JSON or a file out. Send exactly one of `template_id` or `html` to `POST /v1/render`. Templates use Jinja (`{{ placeholders }}`, loops, filters). JavaScript does not run in templates. Every error has the shape `{"error": {"code": "...", "message": "...", "details": {...}}}`. ## Quickstart Get a free key at https://pagepenny.com/login, then: ``` curl https://api.pagepenny.com/v1/render \ -H "Authorization: Bearer pp_live_..." \ -H "Content-Type: application/json" \ -d '{"template_id": "tpl_invoice_classic", "data": {"seller": {"name": "Northwind"}, "customer": {"name": "Acme Corp"}, "invoice": {"number": "INV-1", "date": "2026-10-15"}, "items": [{"description": "Design", "quantity": 1, "unit_price": 2400}]}}' ``` The response includes `id`, `status`, `format`, `pages`, `bytes`, `warnings`, and a download `url` valid for 24 hours by default. ## POST /v1/render fields - `template_id`: a starter template, e.g. `tpl_invoice_classic`. - `html`: your own HTML, up to 2 MB. - `data`: the JSON your template uses, up to 1 MB. - `format`: `pdf`, `png`, `jpeg` or `webp`. Defaults to the template's format, or `pdf`. - `pdf`: `{ page_size: Letter|A4|..., landscape, margin: "12mm", scale }`. - `image`: `{ width, height, scale, quality, full_page }`, up to 4096 px a side. - `output`: `url` (default), `binary` (raw file, up to 4 MB), or `base64`. - `async`: `true` queues the render and returns 202 with an id. Use for long documents (up to 500 pages). - `webhook_url`: with `async`, an https URL that gets a POST when the render finishes. - `expires_in`: download link lifetime in seconds. Default 86400, max 604800. Filters: `{{ amount | money('USD') }}`, `{{ when | date('medium') }}`, `{{ x | number(2) }}`. Missing values render blank and come back as a `missing_variable` warning. Send an `Idempotency-Key` header to retry safely; the same key and body returns the original result and is charged once. ## Other endpoints - `GET /v1/templates`: list templates. - `GET /v1/templates/{id}`: one template with sample data showing what it expects. - `GET /v1/renders/{id}`: poll an async render. Starter templates: `tpl_invoice_classic`, `tpl_invoice_modern`, `tpl_receipt_80mm`, `tpl_quote`, `tpl_report_paged`, `tpl_certificate`, `tpl_og_basic`, `tpl_og_blog`, `tpl_social_square`. ## Webhooks Signed with the account's webhook secret: `X-PagePenny-Signature: t=,v1=">`. ## MCP server Remote MCP at `https://api.pagepenny.com/mcp/`, listed in the official MCP registry as `com.pagepenny/pagepenny`. Tools: `list_templates`, `get_template`, `render`, `get_render`. Add to Claude Code: ``` claude mcp add --transport http pagepenny https://api.pagepenny.com/mcp/ \ --header "Authorization: Bearer pp_live_..." ``` ## Errors and limits - 401 `unauthorized`: missing or revoked key. - 404 `template_not_found`: no such template id. - 409 `idempotency_conflict`: same Idempotency-Key, different body. - 413 `too_many_pages` / `input_too_large`: over 50 pages in a sync render (use async), or input over the limit. - 422 `invalid_request` / `template_error`: bad body, or the template failed (line number included). - 429 `rate_limited` / `quota_exceeded`: too fast (see Retry-After), or monthly limit or spend cap reached. - 503 `capacity`: busy, retry after a couple of seconds. Not charged. - 504 `render_timeout`: took over 20s. Retry with async. Rate limits: 10 requests a minute on Free, 120 on paid. Files are kept 7 days; request data is never stored. Renders that fail on PagePenny's side are not charged. ## Docs - [Docs](https://pagepenny.com/docs): full API reference, webhooks, n8n/Make/Zapier, MCP - [Pricing](https://pagepenny.com/pricing): per-render pricing and spend cap - [n8n node](https://www.npmjs.com/package/n8n-nodes-pagepenny): community node `n8n-nodes-pagepenny` ## Optional - [Free tools](https://pagepenny.com/tools): invoice, quote, certificate, HTML to PDF, Markdown to PDF, OG image, no signup - [PagePenny vs Bannerbear](https://pagepenny.com/vs/bannerbear) - [PagePenny vs CraftMyPDF](https://pagepenny.com/vs/craftmypdf) - [PagePenny vs APITemplate.io](https://pagepenny.com/vs/apitemplate) - [PagePenny vs DocRaptor](https://pagepenny.com/vs/docraptor)