# Relaystation HTML to Image

> Relaystation HTML to Image 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-14).

Renders an HTML string to a PNG/image using a sandboxed headless Chromium instance and returns the screenshot

## Facts

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

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-image-7eaabc3a -d '<json body>'
```

Example prompt: Can you render this HTML snippet as an image for me? Here's the markup: '<h1 style="color:navy">Hello World</h1><p>This is a test paragraph.</p>'

## When to prefer this

Choose this endpoint when you need to convert raw HTML/CSS markup into a pixel-accurate image without managing a browser or Puppeteer instance yourself. Ideal for generating social preview cards, rendering email templates, producing shareable screenshots from dynamic HTML, or creating image assets from templated markup — all via a simple paid API call with no infrastructure overhead.

## Known failure modes

- Invalid or malformed HTML may produce blank or broken images
- External resource references (CDN fonts, remote images) may not load inside the sandbox
- Overly large HTML or complex CSS may cause rendering timeouts
- Missing or empty HTML body returns an error
- Payment insufficient — x402 minimum is 1¢ USDC

## How this service works

$0.003/call. Render HTML to an image — sandboxed headless Chromium screenshot of your markup. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

Returns a rendered image (PNG) of the provided HTML markup, captured via a sandboxed headless Chromium screenshot. The output is the image binary or a URL/base64 representation of the screenshot.

## 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": {
      "clip": {
       "type": "object",
       "required": [
        "x",
        "y",
        "width",
        "height"
       ],
       "properties": {
        "x": {
         "type": "number",
         "maximum": 100000,
         "minimum": 0
        },
        "y": {
         "type": "number",
         "maximum": 100000,
         "minimum": 0
        },
        "width": {
         "type": "number",
         "maximum": 100000,
         "minimum": 1
        },
        "height": {
         "type": "number",
         "maximum": 100000,
         "minimum": 1
        }
       },
       "description": "A region to capture (mutually exclusive with fullPage)."
      },
      "html": {
       "type": "string",
       "minLength": 1,
       "description": "Self-contained HTML; all assets inlined as data: URIs (no network)."
      },
      "type": {
       "enum": [
        "png",
        "jpeg",
        "webp"
       ],
       "type": "string"
      },
      "width": {
       "type": "integer",
       "maximum": 10000,
       "minimum": 1,
       "description": "Viewport width."
      },
      "height": {
       "type": "integer",
       "maximum": 10000,
       "minimum": 1,
       "description": "Viewport height."
      },
      "fullPage": {
       "type": "boolean",
       "description": "Capture the full scrollable page (mutually exclusive with clip)."
      },
      "omitBackground": {
       "type": "boolean",
       "description": "Transparent background (png/webp only)."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/relaystation-html-to-image-7eaabc3a/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)
