# x402 Utils — Encode/Decode Text

> x402 Utils — Encode/Decode Text is a paid API for AI agents from utils.kagurazaka.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-29).

Encode or decode text using base64, base64url, hex, URL (percent) encoding, or HTML escaping.

## Facts

- Endpoint: POST https://utils.kagurazaka.dev/v1/encode?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-utils-encode-decode-text-2920b7ac
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2LTny0w12eMxTECHuE_52

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 x402-utils-encode-decode-text-2920b7ac -d '<json body>'
```

Example prompt: Can you base64-encode the text 'hello world' for me?

## When to prefer this

Choose this endpoint when you need a fast, reliable, pay-per-call text encoding or decoding operation without setting up any libraries or runtime — especially for base64, base64url (JWT-safe), hex, percent-encoding, or HTML escaping. Ideal for agents that need to encode/decode strings on the fly within a workflow without depending on execution environments.

## Known failure modes

- Input text exceeds 1 MB limit — request rejected
- Invalid or missing 'op' enum value — validation error
- Malformed base64/hex/URL input when decoding — error or garbled output
- Missing 'text' field in request body — validation error

## How this service works

Encode or decode text: base64, base64url, hex, URL (percent) encoding and HTML escaping.

## Output

A JSON object containing the operation name (op) and the resulting transformed string (result), e.g. {"op":"base64-encode","result":"aGVsbG8gd29ybGQ="}.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "op": {
   "enum": [
    "base64-encode",
    "base64-decode",
    "base64url-encode",
    "base64url-decode",
    "hex-encode",
    "hex-decode",
    "url-encode",
    "url-decode",
    "html-escape",
    "html-unescape"
   ],
   "type": "string",
   "description": "what to do"
  },
  "text": {
   "type": "string",
   "description": "the text (up to 1 MB)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "op": "base64-encode",
  "result": "aGVsbG8gd29ybGQ="
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-utils-encode-decode-text-2920b7ac/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from utils.kagurazaka.dev](https://www.zero.xyz/host/utils.kagurazaka.dev/llms.txt)
