# HTML Entity Encoder

> HTML Entity Encoder is a paid API for AI agents from html.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Encodes plain text into HTML-safe entity references, supporting hex numeric (default), named entities, or full character encoding.

## Facts

- Endpoint: POST https://html.openverbs.com/v1/encode
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/html-entity-encoder-cefb43d6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-JUxgi6DbNlOohjSCq7G6

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 html-entity-encoder-cefb43d6 -d '<json body>'
```

Example prompt: Encode this user-submitted comment into HTML entities so it's safe to embed in the page markup — use named references like &amp; and &copy; where available: 'Hello <World> & "friends" © 2024'

## When to prefer this

Choose this endpoint when you need to encode plain text into HTML entity references before embedding it in HTML markup — especially to prevent XSS or display issues caused by characters like <, >, &, and quotes. Prefer it over manual string replacement or sanitization endpoints when your input is already plain text (not HTML), and you want precise control over encoding style (hex numeric vs. named entities vs. encoding everything).

## Known failure modes

- Input text exceeds 200,000 character limit — request rejected
- Missing required 'text' field in body — validation error
- Invalid bodyType value — request rejected
- Network timeout for very large inputs
- Payment failure via x402 protocol — request not processed

## How this service works

Encode text to HTML entities so it can be safely embedded in markup. By default uses hex numeric references; set useNamedReferences for named entities (&amp;, &copy;) or encodeEverything to encode every character.

## Output

Returns the input text with special and/or all characters replaced by their HTML entity equivalents — hex numeric references by default (e.g. &#x3C; for <), named references if useNamedReferences is true (e.g. &lt;), or every character encoded if encodeEverything is true.

## 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",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 200000,
       "description": "Plain text to encode."
      },
      "encodeEverything": {
       "type": "boolean",
       "description": "Encode every character, not just unsafe ones. Default false."
      },
      "useNamedReferences": {
       "type": "boolean",
       "description": "Use named entities where available. Default false."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/html-entity-encoder-cefb43d6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from html.openverbs.com](https://www.zero.xyz/host/html.openverbs.com/llms.txt)
