# Byte 4-Gram Frequency Counter

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

Counts the frequency of all byte-level 4-grams (4-byte sequences) in a given text string, without any network calls or LLM involvement.

## Facts

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

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-4-gram-frequency-counter-49824bc4 -d '<json body>'
```

Example prompt: Can you count all the byte-level 4-grams and their frequencies in this text: 'The quick brown fox jumps over the lazy dog'?

## When to prefer this

Use this endpoint when you need deterministic, offline byte-level 4-gram frequency counts with no LLM or network dependency. It is ideal for NLP feature extraction, text fingerprinting, similarity analysis, or any pipeline requiring byte ngram statistics computed cheaply and reproducibly. The sandbox unpaid variant (/v1/sandbox/ngram-byte-4) should be preferred for testing before incurring the $0.006 USDC cost.

## Known failure modes

- Input text is empty or below minimum length (minLength: 1) — returns validation error
- Input text exceeds 100,000 character limit — returns error indicating max length exceeded
- Malformed JSON request body — returns HTTP 400 bad request
- Payment not included or insufficient for the $0.006 USDC x402 fee — returns HTTP 402 Payment Required

## How this service works

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

## Output

A map or frequency table of all byte-level 4-gram sequences found in the input text, with their occurrence counts. The response is computed locally with no network or LLM calls, making it fast and deterministic.

## 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-4-gram-frequency-counter-49824bc4/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)
