Render limits and error codes

Every pdfrender limit and error code: 413 html_too_large, 400 external_resource_blocked, 422 too_many_pages, 504 render_timeout — and the fixes.

Last updated

Max source HTML 2 MiB (UTF-8 bytes) via REST; 256 KB via the MCP tool; 100 KB in the browser tool
Max pages 50 per document
Render timeout 20 seconds wall-clock

Errors are stable machine-readable codes — the JSON detail always leads with the code:

Status Code Meaning Fix
413 html_too_large source HTML over 2 MiB shrink inlined assets (guide)
400 external_resource_blocked document references http(s) URLs (listed in the detail) inline them as data: URIs
422 too_many_pages paginates past 50 pages split the document or tighten layout
504 render_timeout render exceeded 20 s simplify the document
429 rate limited per-minute budget exhausted back off; a key raises the limit
402 credits_exhausted monthly credits spent upgrade or wait for the cycle reset

Refund semantics

One successful render = one credit. Any 5xx — including the 504 timeout — refunds the charge automatically; you never pay for a PDF you did not receive. 4xx rejections on keyed calls stay charged, so catch them early: empty html fails validation with 422 before any render starts, and the free browser tool applies the same limits without touching your quota.

Try it free

Try it free — 100 renders a month, no card, real error responses to build against.

FAQ

Am I charged for a failed render?
Not for server-side failures. Metering is charge-on-success, and any 5xx — including a 504 render_timeout — refunds its credit automatically. Client errors (4xx) on keyed calls stay charged.
What is the maximum number of pages in one PDF?
50. A document that paginates past that is rejected with 422 too_many_pages; split it or tighten the layout.
Why did my render time out?
Rendering is capped at 20 seconds of wall-clock time. Very large tables, thousands of elements or heavy font subsetting are the usual causes; simplify the document or split it.
How can I test error handling without spending credits?
Use the free browser tool at /tools/html-to-pdf. It applies the same limits and returns the same error codes without touching your quota.