# Busker Token Counter

> Busker Token Counter is a paid API for AI agents from workbot1.oddsys.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Returns exact BPE token counts for OpenAI-family encodings (o200k_base or cl100k_base) for a single text or batch of up to 100 texts, with optional truncation to a token budget.

## Facts

- Endpoint: POST https://workbot1.oddsys.org/tokens?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/busker-token-counter-70728fad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qfLRiLTVRlnkNYQfpDSPn

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 busker-token-counter-70728fad -d '<json body>'
```

Example prompt: How many o200k_base tokens is this text: 'The quick brown fox jumps over the lazy dog'? Also truncate it to 5 tokens if it exceeds that budget.

## When to prefer this

Use this endpoint when you need guaranteed-accurate BPE token counts matching OpenAI's actual tokenizer — not an approximation — especially for prompt budget management, context window checks, or preprocessing pipelines before calling OpenAI APIs. Prefer this over heuristic character-count estimates or client-side approximations when exact token accounting matters (e.g., fine-tuning, embeddings, cost estimation).

## Known failure modes

- Input exceeds 512 KB per call — request rejected
- Batch exceeds 100 items — validation error
- Invalid or missing encoding value defaults to o200k_base but may return error if malformed
- Empty text input may return 0 tokens or an error depending on implementation
- Payment failure (x402) blocks the call before processing

## How this service works

Exact BPE token counts for OpenAI-family encodings (o200k_base for GPT-4o/4.1/5, cl100k_base for GPT-4/3.5/embeddings), single text or batches, with optional truncation to a token budget. Up to 512 KB per call.

## Output

Returns exact integer token count(s) for each input text under the specified BPE encoding, plus truncated text (and its token count) if a truncate budget was supplied and exceeded. For batch requests, results are returned per item.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Text to count."
  },
  "texts": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "maxItems": 100,
   "description": "Batch of texts."
  },
  "encoding": {
   "enum": [
    "o200k_base",
    "cl100k_base"
   ],
   "type": "string",
   "description": "BPE encoding (default o200k_base)."
  },
  "truncate": {
   "type": "integer",
   "description": "Token budget — when exceeded the response includes the text cut to this many tokens."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/busker-token-counter-70728fad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from workbot1.oddsys.org](https://www.zero.xyz/host/workbot1.oddsys.org/llms.txt)
