HTML to PDF API features
Every document operation behind one bearer key.
Use RelayPDF when you need to render, screenshot, convert, or manipulate documents without shipping Chromium or LibreOffice yourself. One bearer key covers REST, official SDKs, the CLI, and MCP.
HTML to PDF API that converts HTML, Markdown, URLs, and Office files to production PDFs. PDF tools (merge, protect, stamp, forms) are dedicated endpoints after generation.
The conversion matrix.
Source is exactly one of html, url, or a base64 file with a sourceFilename extension. LibreOffice is the default engine; wkhtmltopdf is opt-in for HTML and URL sources. If the container is cold or unreachable you get a 503 convert_unavailable — and you are not billed for it.
Manipulation without a render.
Each input can be a public URL, a temporary RelayPDF file URL, or base64 bytes. Uploads and fetches are capped at 15 MB, and these operations debit only $0.005 each.
Browse PDF tools →Long renders should not block your request.
Set response to async and you get a 202 with a poll URL. Add a callbackUrl for a fire-and-forget POST when the job finishes, or register a dashboard webhook to get signed events for every job and wallet change.
- binary — file bytes with x-relaypdf-id and content-disposition
- url — JSON with a 24-hour download link and expiresAt
- async — 202 with pollUrl; GET /v1/jobs/:id until completed
// async: get a job back, keep your request short
const job = await client.pdf({
url: "https://example.com/report",
filename: "report.pdf",
response: "async",
callbackUrl: "https://api.acme.com/hooks/relaypdf",
});
const done = await client.jobs.wait(job.id);
console.log(done.url); // public for 24 hours