# Byte 2-Gram Frequency Counter

> Byte 2-Gram Frequency Counter is a paid API for AI agents from agentshelf.syntexa.ch, paid per call via x402, $0.004/call, status unknown (last checked 2026-10-02).

Counts all byte bigram (2-gram) occurrences in the provided text, returning frequency statistics for every consecutive byte pair.

## Facts

- Endpoint: POST https://agentshelf.syntexa.ch/v1/ngram-byte-2?utm_source=zero.xyz
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/byte-2-gram-frequency-counter-5032e141
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fUMA2vSl2NYFGT_dDTnnh

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 byte-2-gram-frequency-counter-5032e141 -d '<json body>'
```

Example prompt: Can you count all the byte 2-grams (consecutive byte pairs) in this text: 'Hello world! This is a test string.'?

## When to prefer this

Use this endpoint when you need exact, deterministic byte-level 2-gram frequency counts with no external dependencies. It operates with no network calls and no LLM inference, making it fast, reproducible, and cheap ($0.004 USDC). Prefer the free sandbox endpoint (/v1/sandbox/ngram-byte-2) for testing. Choose this over word-level or character-level n-gram services when you specifically need byte-granularity bigrams.

## Known failure modes

- Empty or missing 'text' field returns a validation error
- Text exceeding 100,000 characters is rejected due to maxLength constraint
- Malformed JSON request body returns a 400 error
- Payment of exactly $0.004 USDC required; insufficient payment returns 402
- Non-UTF-8 or binary content may cause unexpected byte interpretation results

## How this service works

Call when an agent needs counts of byte 2-grams. No network and no LLM. Exact $0.004 USDC. Prefer unpaid POST /v1/sandbox/ngram-byte-2 first.

## Output

A map or frequency table of all consecutive byte pairs (2-grams) found in the input text, with each unique byte pair and its occurrence count. The result is computed locally with no network calls or LLM involvement, making it deterministic and exact.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "examples": [
    "ab ab"
   ],
   "maxLength": 100000,
   "minLength": 1,
   "description": "Input for this SKU. The route description says whether it is plain text, a URL, base64 bytes, or an already-encoded token."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/byte-2-gram-frequency-counter-5032e141/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentshelf.syntexa.ch](https://www.zero.xyz/host/agentshelf.syntexa.ch/llms.txt)
