---
title: "Convert HTML to PDF and return a public download link"
method: POST
path: "/v1/render/pdf"
---

# Convert HTML to PDF and return a public download link

`POST /v1/render/pdf`

## Request

- Base URL: `https://api.munition.io`
- URL: `https://api.munition.io/v1/render/pdf`
- Auth: none required

Convert self-contained HTML with inline CSS into an A4 PDF and return a public download URL. Use for agent-generated reports, invoices, proposals and source lists. Costs 0.020 USDC per call; accepts up to 1 MiB of HTML and produces up to 20 pages / 10 MiB. Submit HTML, not a webpage URL; scripts and external resources are rejected. Uses seven-day deletion eligibility, not a hard public-access cutoff; asynchronous cleanup and caches may persist. Not renewable. Non-guessable public URL, not private: do not submit sensitive content. Direct HTTP x402, or the account-funded MCP tool render_pdf; no MPP route.

## Request body

- RenderPdfInput
  - `html` string, required: Self-contained HTML document (UTF-8, up to 1 MiB) with inline CSS. No JavaScript, iframes, forms, <link>, external or relative resources: scripting is disabled and document requests are intercepted/aborted in an offline browser context, not process-wide OS egress isolation. The Chromium sandbox is disabled; process isolation is a deployment concern. Embed images and fonts as data: URIs (png, jpeg, gif, webp, svg, woff/woff2/ttf/otf). Output is A4, up to 20 pages / 10 MiB on successful return, with a 10-second application-level render watchdog budget. Launch, shutdown and cleanup can extend elapsed call time; this is not a hard process-lifetime bound. Page and PDF-byte limits are checked after PDF allocation and do not bound peak memory or CPU.
  - `filename` string: Optional filename used for a readable public URL slug, for example invoice-2026-09.pdf. Consecutive dots (..) anywhere are invalid.

## Response `200`

Public nonconfidential PDF, not renewable; seven-day deletion eligibility, not a hard public-access cutoff (asynchronous cleanup and caches may persist)

- RenderPdfOutput
  - `id` string, required: Munition render id.
  - `publicUrl` string, uri, required: Non-guessable public files.munition.io URL of the rendered PDF; do not render confidential content. PDF render artifacts are not renewable via direct x402 or MPP upload-renew endpoints, unlike ordinary uploads.
  - `expiresAt` string, date-time, required: Seven-day deletion eligibility, not an exact public-access cutoff. Daily cleanup and asynchronous S3 lifecycle deletion may run later; cached responses can persist. No hard deletion deadline is guaranteed. PDF render artifacts are not renewable.
  - `bytes` integer, required: Size of the PDF in bytes.
  - `pages` integer, required: Number of A4 pages in the PDF.
  - `sha256` string, required: Lowercase hex SHA-256 of the PDF bytes.
  - `renderMs` integer, required: Server-side render time in milliseconds.

## Other responses

- `400`: Signed input rejected before payment verification, reservation or settlement. error.code=invalid_input; reason is invalid_json, invalid_input or forbidden_html, with at most three allowlisted path/rule issues and a minimal valid example. Submitted content is never echoed.
- `402`: Unsigned requests receive the standard x402 PAYMENT-REQUIRED challenge before body parsing, including empty/malformed JSON; this is discovery, not input validation or renderer readiness. Canonical body schema: extensions.bazaar.schema.properties.input.properties.body. Signed payment rejection or settlement failure can also return 402; inspect the response, do not blindly pay again.
- `409`: Replay conflict or payment requires reconciliation; do not pay again
- `503`: After signed input passes static validation, an unconfigured renderer is unpaid/unavailable; unsigned discovery does not check renderer configuration. render_settlement_unknown: ambiguous settlement, not proof of payment. Known-paid interrupted effect: pending manual reconciliation. Preserve paidCallId and payment evidence securely; do not pay again. No automatic PDF recovery/refund; owner-approved manual resolution: delivery without another charge or an explicitly authorized refund after verifying payment and non-delivery; no automatic refund or promised resolution SLA.

---

[API](https://skmtc.dev/munition/apis/munition-api.md) · [All operations](https://skmtc.dev/munition/apis/munition-api/llms.txt) · [OpenAPI document](https://skmtc.dev/munition/apis/munition-api/revisions/3b11109809d1?raw)
