# Character 2-gram Counter

> Character 2-gram 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-09-29).

Counts all character-level 2-grams (bigrams) in a given text string, returning their frequencies without any network calls or LLM inference.

## Facts

- Endpoint: POST https://agentshelf.syntexa.ch/v1/ngram-char-2?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/character-2-gram-counter-a07ce0f2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WP4bHC6AKhc7bDpDbRm1M

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-2-gram-counter-a07ce0f2 -d '<json body>'
```

Example prompt: Count all character 2-grams in this text and give me their frequencies: 'The quick brown fox jumps over the lazy dog.'

## When to prefer this

Prefer this endpoint when you need exact, deterministic character bigram counts at low cost ($0.006 USDC) and do not require word-level or higher-order n-grams. It is the right choice when you want purely computational results with no LLM involvement and no external data dependencies. Use the free sandbox endpoint (/v1/sandbox/ngram-char-2) first for testing before paying.

## Known failure modes

- Empty or missing text field returns a validation error
- Text exceeding 100,000 characters is rejected
- Malformed JSON body returns a 400 error
- Payment of exactly $0.006 USDC must be provided via x402 protocol or the request is rejected with 402

## How this service works

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

## Output

A map (dictionary) of every two-character sequence found in the input text, along with the integer count of how many times each appears. All computation is done locally with no external network calls or LLM inference.

## 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-2-gram-counter-a07ce0f2/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)
