# Character 4-gram Counter

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

Counts occurrences of every character-level 4-gram (sliding window of 4 consecutive characters) in a given text string, with no network calls or LLM involvement.

## Facts

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

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 character-4-gram-counter-247821d5 -d '<json body>'
```

Example prompt: Count the character 4-grams in this text: 'The quick brown fox jumps over the lazy dog' — give me the frequency of every 4-character sliding window sequence.

## When to prefer this

Use this endpoint when you need exact, deterministic character 4-gram counts from a text string with no LLM involvement and no network dependencies. It is preferable when you need reproducible ngram statistics for NLP feature engineering, language modeling, or text fingerprinting. Try the unpaid sandbox at POST /v1/sandbox/ngram-char-4 first to validate your integration before paying.

## Known failure modes

- Empty or missing 'text' field returns a validation error
- Text exceeding 100,000 characters is rejected
- Payment of exactly $0.008 USDC required; insufficient or missing payment results in 402 response
- Malformed JSON body returns 400 error

## How this service works

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

## Output

A map of every distinct 4-character substring (sliding window, step 1) found in the input text to its integer occurrence count, computed deterministically with no external calls.

## 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/character-4-gram-counter-247821d5/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)
