# PennyRail LLM Token Counter

> PennyRail LLM Token Counter is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Counts the number of LLM tokens in a given text input using a machine-readable settlement service

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/p/nano/text.token-count--llm-token-count
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pennyrail-llm-token-counter-1faafee1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ugQFdSU0qg7jNfdO1Iair

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 pennyrail-llm-token-counter-1faafee1 -d '<json body>'
```

Example prompt: How many LLM tokens are in this text: 'The quick brown fox jumps over the lazy dog and then runs back again to see what happened'?

## When to prefer this

Choose this endpoint when you need a quick, paid-per-call token count without hosting your own tokenizer library, especially in serverless or agent contexts where installing tiktoken or similar is impractical. Best for low-volume spot checks or when you need a neutral third-party token count billed via USDC microtransaction.

## Known failure modes

- Missing or malformed 'input' object returns a validation error
- Empty text input may return zero or an error
- Payment failure (402) if USDC microtransaction is not completed
- Oversized input may be rejected or time out
- Ambiguous tokenizer not specified may return counts for a default model only

## How this service works

Machine-readable settlement service

## Output

Returns a token count (and possibly additional token metrics) for the provided text input, computed according to LLM tokenization rules.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-llm-token-counter-1faafee1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
