Quick start
rustedf.cloud turns an HTML template and some data into a PDF. You call one endpoint with an API key; the PDF comes back in the response.
1. Create an account and a key
Section titled “1. Create an account and a key”Sign in to the portal with your email. We send a link; there is no password. Open API keys, create a key and copy it. It is shown once.
2. Render a document
Section titled “2. Render a document”Send HTML and data in one request. The HTML is a template: {{ name }} is replaced by
the value of name in data.
curl -X POST https://api.example.com/v1/render \ -H "Authorization: Bearer $RUSTEDF_KEY" \ -H "Content-Type: application/json" \ -d '{ "html": "<h1>Hello {{ name }}</h1>", "data": { "name": "World" } }' \ -o hello.pdfOpen hello.pdf. One credit was used. Your remaining credits are in the
X-Credits-Remaining response header.
3. Use a saved template
Section titled “3. Use a saved template”Real documents live in templates you edit in the portal, with a live preview. Render one by id:
import { writeFile } from 'node:fs/promises';
const response = await fetch('https://api.example.com/v1/render', { method: 'POST', headers: { Authorization: `Bearer ${process.env.RUSTEDF_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ template_id: '0194f2c0-…', locale: 'pt-BR', data: { number: '2025-0042', total: '2040.50' }, }),});
if (!response.ok) throw new Error((await response.json()).error.message);await writeFile('invoice.pdf', Buffer.from(await response.arrayBuffer()));- Rendering a PDF: every option, and getting a link instead of bytes.
- Templates: loops, conditions and filters.
- Locales and formatting: numbers, currencies and dates for any market.
- Validating a document: find problems before they cost a credit.