# pdfrender
> HTML to PDF REST API and MCP server with a free tier
## API
- Base URL: `https://api.pdfrender.dev` — send API requests there.
- [API reference](https://pdfrender.dev/docs): interactive; machine-readable OpenAPI spec at https://api.pdfrender.dev/openapi.json.
- [Pricing](https://pdfrender.dev/pricing): Free plus Essential, Scale plans; monthly credits reset each cycle.
- Auth: send an `X-API-Key` header (create keys after signing in).
- Anonymous requests work at a lower, IP-based rate limit.
- [Health](https://api.pdfrender.dev/health): liveness probe.
## MCP
- The Model Context Protocol surface is served at `https://api.pdfrender.dev/mcp` (streamable HTTP, JSON).
- `tools/list` is open for discovery; tool calls use the same key + credit tier as REST.
- [Install in your AI client](https://pdfrender.dev/connect): copy-paste and one-click setup for Claude Code, Cursor and VS Code.
## Guides
- [Convert HTML to PDF with curl](https://pdfrender.dev/guides/html-to-pdf-curl): Render HTML to PDF from the command line with one curl call. Works anonymously — an API key raises the rate limit. Full request and limits.
- [HTML to PDF in Python](https://pdfrender.dev/guides/html-to-pdf-python): Generate PDFs from HTML in Python with requests or httpx — one POST, no browser or wkhtmltopdf binary to install. Copy-paste example inside.
- [HTML to PDF in Node.js](https://pdfrender.dev/guides/html-to-pdf-node): Render HTML to PDF from Node.js with the built-in fetch — no Puppeteer, no Chromium download. One POST request, copy-paste example inside.
- [PDF headers, footers and page numbers with CSS](https://pdfrender.dev/guides/pdf-headers-and-footers): Add running headers, footers and 'Page X of Y' numbering to API-generated PDFs using CSS @page margin boxes — no post-processing step.
- [PDF page size, orientation and margins with CSS @page](https://pdfrender.dev/guides/pdf-page-size-and-margins): Set A4, Letter, landscape or fully custom PDF page sizes and margins with the CSS @page rule — one style block, no API parameters needed.
- [Generate invoice PDFs from HTML templates](https://pdfrender.dev/guides/invoice-pdf-from-html): Turn an HTML invoice template into a pixel-faithful PDF via API: template with your stack, style with CSS, POST to /v1/render. Example included.
- [Images and custom fonts in API-rendered PDFs](https://pdfrender.dev/guides/inline-images-and-fonts): pdfrender never fetches external URLs — embed images, fonts and CSS as data: URIs instead. Why that design is safer, and how to inline assets.
- [HTML to PDF from Claude and LLM agents (MCP)](https://pdfrender.dev/guides/html-to-pdf-mcp): pdfrender ships a built-in MCP server: agents call the render_html_to_pdf tool to produce real PDFs. Setup for Claude Code and any MCP client.
- [API keys, rate limits and the free tier](https://pdfrender.dev/guides/api-keys-and-rate-limits): How pdfrender access works: anonymous calls at a per-IP limit, API keys that raise it, credit-metered renders, and what each response header means.
- [Render limits and error codes](https://pdfrender.dev/guides/render-errors-and-limits): Every pdfrender limit and error code: 413 html_too_large, 400 external_resource_blocked, 422 too_many_pages, 504 render_timeout — and the fixes.
## Compare
- [pdfrender vs PDFShift](https://pdfrender.dev/compare/pdfrender-vs-pdfshift): PDFShift is a hosted Chrome-based HTML-to-PDF API; pdfrender is a WeasyPrint-based API with flat subscriptions and an MCP server. Honest comparison.
- [pdfrender vs CraftMyPDF](https://pdfrender.dev/compare/pdfrender-vs-craftmypdf): CraftMyPDF generates PDFs from a drag-and-drop template editor plus JSON data; pdfrender renders the HTML you send. Which model fits your team?
- [pdfrender vs Api2Pdf](https://pdfrender.dev/compare/pdfrender-vs-api2pdf): Api2Pdf is a multi-engine conversion API (Chrome, LibreOffice, wkhtmltopdf) with pay-per-use pricing; pdfrender does one thing with flat plans.
- [pdfrender vs DocRaptor](https://pdfrender.dev/compare/pdfrender-vs-docraptor): DocRaptor is the hosted API for the commercial Prince engine — the print-CSS gold standard; pdfrender offers the same CSS Paged Media model for less.
- [pdfrender vs SelectPdf](https://pdfrender.dev/compare/pdfrender-vs-selectpdf): SelectPdf is a .NET HTML-to-PDF library with a hosted REST API on the side; pdfrender is API-first and language-neutral. Which shape suits you?
- [pdfrender vs Gotenberg](https://pdfrender.dev/compare/pdfrender-vs-gotenberg): Gotenberg is a free, self-hosted Docker API (Chromium + LibreOffice) you operate yourself; pdfrender is the hosted, zero-ops alternative.
## About
- [About](https://pdfrender.dev/about)
- [Privacy](https://pdfrender.dev/privacy)
- [Terms](https://pdfrender.dev/terms)
- [Impressum](https://pdfrender.dev/imprint)