# AGISHub HTML-to-PDF Renderer

> AGISHub HTML-to-PDF Renderer is a paid API for AI agents from api.agishub.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Renders a public URL or raw HTML string into a PDF document, returned as a base64-encoded string, using a headless browser.

## Facts

- Endpoint: GET https://api.agishub.com/v1/pdf
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agishub-html-to-pdf-renderer-d146df0d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YYIB56MCUUpNSSIa5_7lJ

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 agishub-html-to-pdf-renderer-d146df0d
```

Example prompt: Can you render this invoice HTML into a PDF for me? Here's the raw HTML: '<html><body><h1>Invoice #1042</h1><p>Amount due: $500</p></body></html>' — use A4 paper size in portrait orientation.

## When to prefer this

Choose this endpoint when you need server-side, headless-browser-accurate PDF rendering from either a live public URL or a raw HTML string, especially for invoices, receipts, or reports where CSS and JavaScript rendering fidelity matters. Prefer it over client-side PDF libraries when you need a reliable, hosted, per-call service without managing browser infrastructure yourself.

## Known failure modes

- Invalid or unreachable URL returns an error (URL must be publicly accessible over HTTP/HTTPS)
- Malformed HTML may produce a blank or broken PDF
- Missing both 'url' and 'html' parameters causes a validation error
- Unsupported paper format enum value returns a schema validation error
- Very large or complex pages may time out during headless browser rendering
- Payment failure (402) if USDC balance or x402 credentials are insufficient

## How this service works

Render a public URL or a raw HTML string into a PDF document, returned base64-encoded. Backed by a headless browser. Use for invoices, reports, receipts and any HTML-to-PDF need.

## Output

A JSON response containing a base64-encoded PDF string in the 'result' field, representing the fully rendered page or HTML content as a PDF document ready to decode and save or send.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "enum": [
      "http"
     ],
     "type": "string"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "description": "Public http/https URL to render to PDF. Provide this OR html."
      },
      "html": {
       "type": "string",
       "description": "Raw HTML string to render to PDF. Provide this OR url."
      },
      "format": {
       "enum": [
        "A4",
        "Letter",
        "Legal",
        "A3",
        "A5",
        "Tabloid"
       ],
       "type": "string",
       "description": "Paper size (default A4)."
      },
      "landscape": {
       "type": "boolean",
       "description": "Landscape orientation (default false = portrait)."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "enum": [
      "json"
     ],
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": "Render a public URL or a raw HTML string into a PDF document, returned base64-encoded. Backed by a headless browser. Use"
 }
}
```

## More

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