# agent402.tools HTML Entities Encoder/Decoder

> agent402.tools HTML Entities Encoder/Decoder is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Encodes plain text to HTML entities or decodes HTML entity sequences back to plain text

## Facts

- Endpoint: POST https://agent402.tools/api/html-entities
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-html-entities-encoder-decoder-7f3da405
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_keevpW5wGgBhmglK2gVqC

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 agent402-tools-html-entities-encoder-decoder-7f3da405 -d '<json body>'
```

Example prompt: Take this string — 'Hello <World> & "Friends"' — and encode it to HTML entities so it's safe to embed in a webpage.

## When to prefer this

Use this endpoint when you need a quick, reliable API call to encode or decode HTML entities without running local code. Ideal for agents that need to sanitize user-generated content before inserting it into HTML, or parse HTML entity sequences from scraped web content into readable text.

## Known failure modes

- Missing or empty text field returns an error or empty result
- Invalid mode value (not 'encode' or 'decode') may default to encode or return an error
- Payment failure (402) if USDC balance is insufficient
- Malformed JSON request body returns a 400-level error
- Very large text strings may hit payload size limits

## How this service works

Encode text to HTML entities or decode them back. mode: encode (default) or decode.

## Output

Returns the transformed text string: either with special characters replaced by their HTML entity equivalents (e.g. < becomes &lt;, & becomes &amp;) in encode mode, or with HTML entity sequences converted back to their original characters in decode mode.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "type": "string",
   "description": "encode | decode"
  },
  "text": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "encode",
  "result": "&lt;a href=&quot;x&quot;&gt;"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-html-entities-encoder-decoder-7f3da405/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
