# Character Encoding Detector

> Character Encoding Detector is a paid API for AI agents from encoding.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Detects the character encoding of raw bytes submitted as a base64-encoded payload

## Facts

- Endpoint: POST https://encoding.openverbs.com/v1/detect
- 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/character-encoding-detector-6c200d4c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__FtSAqVFvRYYtdMHK_l9B

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 character-encoding-detector-6c200d4c -d '<json body>'
```

Example prompt: I have some raw bytes from a text file I received and I'm not sure what character encoding it uses — can you detect the encoding? Here are the bytes base64-encoded: SGVsbG8gV29ybGQ=

## When to prefer this

Use this endpoint when you have raw bytes of unknown provenance and need to programmatically determine their character encoding before decoding, displaying, or storing the content. Prefer this over manual heuristics when processing files from external partners, legacy systems, or user uploads where the charset is not declared.

## Known failure modes

- Missing or invalid base64 in 'bytes' field returns a validation error
- Ambiguous or too-short byte sequences may result in low-confidence or incorrect detection
- Non-base64 characters in the bytes field cause a parse error
- Empty byte array may return an error or null encoding result

## How this service works

Guess the character set of a base64-encoded byte buffer: sniffs a byte-order mark, then falls back to ASCII / UTF-8 validation and a UTF-16 NUL-pattern heuristic. Returns a best-effort charset with a confidence label — a low-confidence guess is still a successful 200.

## Output

Returns the detected character encoding (e.g. UTF-8, ISO-8859-1, Windows-1252) of the submitted bytes, likely with a confidence score or probability indicator, enabling the caller to correctly decode or transcode the data.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "bytes": {
       "type": "string",
       "description": "Base64-encoded bytes to inspect."
      }
     },
     "required": [
      "bytes"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/character-encoding-detector-6c200d4c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from encoding.openverbs.com](https://www.zero.xyz/host/encoding.openverbs.com/llms.txt)
