# Text Statistics Counter (Bytes, Characters, Words, Lines)

> Text Statistics Counter (Bytes, Characters, Words, Lines) is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Counts bytes, characters, words, and lines in a given string and returns all four metrics in a single response.

## Facts

- Endpoint: POST https://twin.unykorn.org/text-stats?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/text-statistics-counter-bytes-characters-words-lines-bbeb3a3e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_klXtwzSLh-wYJpFje380t

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 text-statistics-counter-bytes-characters-words-lines-bbeb3a3e -d '<json body>'
```

Example prompt: Can you count the bytes, characters, words, and lines in this text for me: 'The quick brown fox jumps over the lazy dog. It was a bright cold day in April.'

## When to prefer this

Use this endpoint when you need a fast, deterministic, multi-dimensional text measurement (bytes, characters, words, and lines simultaneously) without running local string processing. Ideal for agents that need to validate content against size constraints, prepare text for downstream APIs with strict limits, or audit document metrics in a single call. Prefer this over client-side counting when consistency across encodings matters or when the agent environment lacks reliable string utilities.

## Known failure modes

- Text exceeds 49,152 character limit — request rejected
- Empty or missing text field — may return zero counts or validation error
- Non-UTF-8 byte sequences may cause unexpected byte vs character count discrepancies
- Payment failure on the x402 micropayment layer — call not processed
- Network timeout on the UnyKorn operator node

## How this service works

Byte, character, word and line counts for a string — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with ok:true, type:'text-stats', and the four computed metrics (byte count, character count, word count, line count) for the submitted string, along with a payment receipt containing the transaction hash, amount in USD, and a receipt ID.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "text": {
     "type": "string",
     "maxLength": 49152
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "text-stats",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.001,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/text-statistics-counter-bytes-characters-words-lines-bbeb3a3e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
