# RelayStation HTML Sanitizer

> RelayStation HTML Sanitizer 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).

Sanitizes HTML against a safe whitelist by stripping scripts, event handlers, and XSS vectors before embedding user-generated content

## Facts

- Endpoint: POST https://api.relaystation.ai/v1/text/sanitize-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-sanitizer-8ce5831a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BNMMCtUtgbK7u3RrhMfhL

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-sanitizer-8ce5831a -d '<json body>'
```

Example prompt: Sanitize this HTML snippet I got from a user comment form before I embed it on the page — strip out any scripts, event handlers, or XSS payloads and give me back only safe, whitelisted markup: '<p onclick="alert(1)">Hello <script>evil()</script> world</p>'

## When to prefer this

Choose this endpoint when you need to safely embed user-generated or third-party HTML content in a web page, database, or email and need server-side XSS stripping rather than a client-side library. Ideal for agents processing untrusted HTML at scale where a whitelist-based server sanitization step is required before storage or rendering, and per-MB micropayment pricing makes it cost-effective for variable payload sizes.

## Known failure modes

- Malformed or non-UTF-8 input HTML may cause parsing errors
- Extremely large HTML payloads may exceed per-MB pricing thresholds or size limits
- Overly aggressive sanitization may strip legitimate but edge-case safe tags not on the whitelist
- Network timeout if payload is very large; retry recommended
- Payment failure if insufficient USDC balance for x402 transaction

## How this service works

$0.0002/MB. Sanitize HTML against a safe whitelist — kill scripts and XSS before embedding. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny

## Output

Returns the sanitized HTML string with all unsafe elements removed — scripts, event handlers, javascript: URLs, iframes, and other XSS vectors stripped out, while preserving safe whitelisted tags and attributes for valid rendering.

## 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": {
     "properties": {}
    },
    "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-sanitizer-8ce5831a/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)
