# Rasterly PDF Generation API

> Rasterly PDF Generation API is a paid API for AI agents from rasterly-x402-production.up.railway.app, paid per call via x402, $0.008/call, status unknown (last checked 2026-10-11).

Renders a URL or raw HTML into a PDF document with configurable page size, margins, orientation, and headers/footers

## Facts

- Endpoint: POST https://rasterly-x402-production.up.railway.app/v1/pdf?utm_source=zero.xyz
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/rasterly-pdf-generation-api-1a3a84b0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QqQ4vNpWDQjPmgV28fJDD

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 rasterly-pdf-generation-api-1a3a84b0 -d '<json body>'
```

Example prompt: Can you convert https://example.com/report to a PDF in Letter format with landscape orientation and include page numbers in the footer?

## When to prefer this

Choose this endpoint when you need a production-quality PDF rendered from a live URL or raw HTML, especially in agentic workflows where no API key setup is desired and per-call USDC micropayments via x402 are acceptable. Prefer it over headless browser DIY setups when you want a managed rendering service. Use it when you need precise control over page format, margins, orientation, and custom headers/footers.

## Known failure modes

- URL is not publicly accessible — returns error if the target page is behind authentication or a firewall
- Invalid HTML submitted — malformed markup may produce broken or blank PDF output
- Unsupported page format enum value — must be one of A4, A3, A5, Letter, Legal, Tabloid
- Scale value out of range — must be between 0.1 and 2.0
- Payment failure via x402 protocol — call rejected if USDC payment of $0.008 is not completed
- Timeout rendering complex pages — heavy JavaScript-rendered pages may time out

## How this service works

The web-rendering layer for AI agents, sold per-call over the x402 payment protocol. Turn any URL into a screenshot, a PDF, or clean LLM-ready Markdown. No API keys, no accounts.

## Output

Raw PDF bytes returned as application/pdf content. The response body is the binary PDF file, not JSON. The agent receives a fully rendered PDF document ready to save, attach, or display.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Fetch + render this URL instead (public only)"
  },
  "html": {
   "type": "string",
   "description": "Raw HTML document (required if no url)"
  },
  "scale": {
   "type": "number",
   "description": "Render scale 0.1–2 (default 1)"
  },
  "format": {
   "enum": [
    "A4",
    "A3",
    "A5",
    "Letter",
    "Legal",
    "Tabloid"
   ],
   "type": "string",
   "description": "Page size (default A4)"
  },
  "margin": {
   "type": "string",
   "description": "Margin, e.g. \"0.5in\", or a {top,right,bottom,left} object"
  },
  "landscape": {
   "type": "boolean",
   "description": "Landscape orientation"
  },
  "footer_html": {
   "type": "string",
   "description": "Footer template (e.g. page numbers)"
  },
  "header_html": {
   "type": "string",
   "description": "Header template (Chromium print syntax)"
  },
  "print_background": {
   "type": "boolean",
   "description": "Print CSS backgrounds (default true)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "response body is the raw PDF bytes, not JSON",
  "content_type": "application/pdf"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rasterly-pdf-generation-api-1a3a84b0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rasterly-x402-production.up.railway.app](https://www.zero.xyz/host/rasterly-x402-production.up.railway.app/llms.txt)
