# TextKit Byte Encoding Detector

> TextKit Byte Encoding Detector is a paid API for AI agents from textkit.johnaio281.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-22).

Detects the character encoding of a byte array (e.g. ASCII, UTF-8, UTF-16) with a confidence score

## Facts

- Endpoint: GET https://textkit.johnaio281.workers.dev/api/tk/detect-encoding?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/textkit-byte-encoding-detector-ca9cbb86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5XsJTMrNmpgJoM0a3jJAC

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 textkit-byte-encoding-detector-ca9cbb86
```

Example prompt: I have a byte array [72,101,108,108,111,32,87,111,114,108,100] — can you detect what character encoding it is using TextKit?

## When to prefer this

Use this endpoint when you have raw bytes (not a string) and need to programmatically detect the character encoding before decoding or processing text. Ideal for agents handling file uploads, API responses, or binary streams where encoding is unknown. Prefer this over manual heuristics when you need a confidence score alongside the encoding name.

## Known failure modes

- Missing 'bytes' query parameter returns an error
- Bytes outside the 0-255 range are rejected by schema validation
- Empty byte array may return low-confidence or ambiguous result
- Ambiguous byte sequences may yield low confidence scores
- Payment failure via x402 if insufficient USDC balance on Base

## How this service works

General-purpose text, Unicode and date utilities for AI agents: homoglyph folding and spoofed-domain detection, Unicode script detection, NFC/NFD normalization, grapheme counting, date description (weekday, ISO week, quarter, leap year), business-day counting, slugify, FNV-1a hashing, Shannon entropy, string format detection (uuid, email, url, ipv4, jwt, iban), byte-encoding detection and human-readable byte sizes. Pay per request in USDC on Base via x402 - no signup, no API key, no KYC.

## Output

A JSON object with an 'encoding' field (string, e.g. 'ascii', 'utf-8', 'utf-16') and a 'confidence' field (number between 0 and 1) indicating how certain the detection is.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "bytes"
     ],
     "properties": {
      "bytes": {
       "type": "array",
       "items": {
        "type": "integer",
        "maximum": 255,
        "minimum": 0
       },
       "description": "byte array"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "encoding": "ascii",
  "confidence": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/textkit-byte-encoding-detector-ca9cbb86/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from textkit.johnaio281.workers.dev](https://www.zero.xyz/host/textkit.johnaio281.workers.dev/llms.txt)
