# Encode / Decode

> Encode / Decode is a paid API for AI agents from bess-x402.onrender.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-30).

Encode or decode text using formats like base64, hex, URL percent-encoding, HTML entities, ROT13, binary, Unicode escapes, and punycode, with auto-detect support.

## Facts

- Endpoint: GET https://bess-x402.onrender.com/v1/util/encode?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/encode-decode-fc4135ff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Mr3QrGXy9qIhTVQ9QFFdg

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 encode-decode-fc4135ff
```

Example prompt: Can you base64-decode this string for me: 'SGVsbG8sIFdvcmxkIQ=='?

## When to prefer this

Choose this endpoint when you need to programmatically encode or decode text in any of the supported formats (base64, base64url, hex, URL encoding, HTML entities, ROT13, binary, Unicode escapes, punycode) — especially when you don't know the encoding type and want auto-detection. It covers a broad range of common encoding formats in a single endpoint, making it ideal for general-purpose text transformation tasks in agent workflows.

## Known failure modes

- Invalid or malformed input text that cannot be decoded in the specified format
- Unsupported encoding operation name returns an error
- Missing required 'text' query parameter returns a validation error
- Auto-detect ('detect' operation) may fail or return ambiguous results if the input matches multiple encodings
- Non-UTF-8 binary data passed as text may cause decoding errors

## How this service works

Encode or decode text: base64, base64url, hex, URL percent-encoding, HTML entities, ROT13, binary, Unicode escapes and punycode, or detect to try decoding unknown input.

## Output

The agent receives the transformed text result — either the encoded or decoded version of the input string — along with metadata about the operation performed (e.g. encoding format detected or applied). For 'detect' operations, the response includes the identified encoding type and the decoded value.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Input text"
      },
      "operation": {
       "type": "string",
       "description": "e.g. base64_encode, url_decode, detect"
      }
     }
    }
   },
   "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/encode-decode-fc4135ff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bess-x402.onrender.com](https://www.zero.xyz/host/bess-x402.onrender.com/llms.txt)
