# Relaystation HTML to PDF

> Relaystation HTML to PDF is a paid API for AI agents from api.relaystation.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Renders an HTML document to a print-quality PDF using sandboxed headless Chromium

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/pdf/from-html
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/relaystation-html-to-pdf-f736edd9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_J_bl-oNpAERo_tN_dNFom

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability relaystation-html-to-pdf-f736edd9 -d '<json body>'
```

Example prompt: Take this HTML invoice markup I have and render it into a clean, print-quality PDF — use sandboxed headless Chromium so the CSS and layout come out exactly right.

## When to prefer this

Choose this endpoint when you need to programmatically convert HTML markup — including full CSS styling — into a print-quality PDF, especially for invoices, reports, or templates. It is preferable over generic PDF libraries when CSS fidelity and Chromium-accurate rendering are important. Use it when you already have HTML content and need a reliable, per-call, pay-as-you-go PDF generation service without managing your own headless browser infrastructure.

## Known failure modes

- Malformed or incomplete HTML may produce garbled or blank PDF output
- External resources (images, fonts, stylesheets) referenced by URLs may fail to load in the sandboxed environment
- Very large or complex HTML documents may time out or exceed memory limits
- Missing or unsupported CSS features may cause layout differences from browser rendering
- Network-dependent assets may not render if sandboxing blocks outbound requests

## How this service works

$0.003/call. Render HTML to PDF — sandboxed headless Chromium, print-quality output. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

A binary PDF file rendered from the provided HTML input using headless Chromium, with print-quality layout and full CSS support. The response contains the PDF bytes ready for storage, download, or forwarding.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "properties": {
      "html": {
       "type": "string",
       "minLength": 1,
       "description": "The HTML to render; all assets inlined as data: URIs / inline <style>."
      },
      "options": {
       "type": "object",
       "properties": {
        "scale": {
         "type": "number",
         "maximum": 2,
         "minimum": 0.1
        },
        "format": {
         "enum": [
          "A4",
          "Letter",
          "Legal",
          "A3",
          "A5",
          "Tabloid",
          "Ledger"
         ],
         "type": "string"
        },
        "margin": {
         "type": "object",
         "properties": {
          "top": {
           "type": "string",
           "description": "CSS size, e.g. \"10mm\"."
          },
          "left": {
           "type": "string"
          },
          "right": {
           "type": "string"
          },
          "bottom": {
           "type": "string"
          }
         }
        },
        "tagged": {
         "type": "boolean",
         "description": "Emit a tagged (accessible) PDF (default true)."
        },
        "landscape": {
         "type": "boolean"
        },
        "pageRanges": {
         "type": "string",
         "maxLength": 255,
         "description": "Page subset to print, e.g. \"1-5, 8\" (default: all pages)."
        },
        "footerTemplate": {
         "type": "string",
         "maxLength": 50000,
         "description": "HTML print footer; same classes/sandbox as headerTemplate."
        },
        "headerTemplate": {
         "type": "string",
         "maxLength": 50000,
         "description": "HTML print header; use the date/title/url/pageNumber/totalPages classes. Rendered under the data:-only sandbox."
        },
        "printBackground": {
         "type": "boolean"
        },
        "displayHeaderFooter": {
         "type": "boolean",
         "description": "Render the header/footer templates (default false; auto-enabled when a template is supplied)."
        }
       }
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/relaystation-html-to-pdf-f736edd9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.relaystation.ai](https://www.zero.xyz/host/api.relaystation.ai/llms.txt)
