Generate PDF
generate_pdfGenerate a PDF from raw HTML, a public URL, or a template + JSON data. Returns the PDF as base64. Priced per document; retries with the same idempotencyKey never double-generate. The canonical way for an AI agent to turn content into a shareable, correctly-formatted PDF.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | What to render. Provide exactly one of: html, url, or (template|templateId) with data. | |
| options | No | Optional page and print settings. | |
| idempotencyKey | No | A stable key (e.g. an invoice id). Repeat calls with the same key return the stored result instead of re-rendering or re-billing. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| byteSize | No | Size of the PDF in bytes. | |
| pageCount | No | Number of pages in the PDF. | |
| bytesBase64 | Yes | The generated PDF, base64-encoded. |