# After 6 Labo x402 Text Stats

> After 6 Labo x402 Text Stats is a paid API for AI agents from after6labo-x402.silly-detective.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-13).

Returns deterministic Unicode text statistics (byte counts, code point counts by script, line counts) for a given UTF-8 string, billed via x402 micropayment.

## Facts

- Endpoint: GET https://after6labo-x402.silly-detective.workers.dev/paid/text-stats?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/after-6-labo-x402-text-stats-4b12734f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_H1EXjSuW0kFweRU3mYBfZ

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 after-6-labo-x402-text-stats-4b12734f
```

Example prompt: Can you get me the full Unicode stats for the text 'Hello, 世界! こんにちは' — I need byte counts, code point counts, and how many Han, hiragana, and katakana characters it contains?

## When to prefer this

Choose this endpoint when you need fast, deterministic, script-aware Unicode statistics — especially for CJK (Han, hiragana, katakana) character counting — and want to pay per-call via x402 micropayment without API key setup. Prefer it over rolling your own Unicode parser when you need authoritative byte and code-unit counts across encodings (UTF-8, UTF-16) in a single call.

## Known failure modes

- Missing 'text' query parameter returns an error
- Text exceeding 2048 characters (maxLength) is rejected
- Non-UTF-8 encoded text may produce unexpected counts
- x402 payment failure blocks the request before processing
- Empty string (minLength 1) is rejected

## How this service works

Deterministic Japanese text utilities for AI agents, paid per call with x402 (USDC on Base): Unicode/Japanese script text statistics, and a Japanese bank-transfer name (Zengin halfwidth kana) format check with reviewable correction candidates.

## Output

A JSON object with integer counts for: utf8Bytes, unicodeCodePoints, utf16CodeUnits, asciiCodePoints, hanCodePoints, hiraganaCodePoints, katakanaCodePoints, and lines. All values are deterministic for a given input string.

## 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": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 2048,
       "minLength": 1,
       "description": "Text to analyze. UTF-8 URL-encode it as the text query parameter."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "lines": {
       "type": "integer"
      },
      "utf8Bytes": {
       "type": "integer"
      },
      "hanCodePoints": {
       "type": "integer"
      },
      "utf16CodeUnits": {
       "type": "integer"
      },
      "asciiCodePoints": {
       "type": "integer"
      },
      "unicodeCodePoints": {
       "type": "integer"
      },
      "hiraganaCodePoints": {
       "type": "integer"
      },
      "katakanaCodePoints": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "paid": true,
  "lines": 1,
  "utf8Bytes": 23,
  "hanCodePoints": 3,
  "utf16CodeUnits": 11,
  "asciiCodePoints": 5,
  "unicodeCodePoints": 11,
  "hiraganaCodePoints": 3,
  "katakanaCodePoints": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/after-6-labo-x402-text-stats-4b12734f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from after6labo-x402.silly-detective.workers.dev](https://www.zero.xyz/host/after6labo-x402.silly-detective.workers.dev/llms.txt)
