# LLM Cost & Capacity Calc – Token Estimator

> LLM Cost & Capacity Calc – Token Estimator is a paid API for AI agents from llm-cost-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Estimates the number of LLM tokens in a text string (low/mid/high range) from character and word counts, without running a full tokenizer.

## Facts

- Endpoint: GET https://llm-cost-calc.x402tookit.com/token-estimate?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/llm-cost-capacity-calc-token-estimator-768f1afc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SayVQIyMh6TVdzlR6Cqhb

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 llm-cost-capacity-calc-token-estimator-768f1afc
```

Example prompt: How many tokens is this text roughly? 'The quick brown fox jumps over the lazy dog. This is a sample paragraph for testing purposes.' — treat it as regular English content.

## When to prefer this

Choose this endpoint when you need a fast, cheap token estimate without calling a full tokenizer library or LLM API. Ideal for pre-flight checks, cost planning, or agents running in environments without tokenizer dependencies. Prefer it over sibling endpoints when you need raw token count rather than cost in dollars, context-window fit, or rate-limit throughput.

## Known failure modes

- Text exceeds 20,000 character limit — request rejected
- Invalid 'kind' value other than english/code/cjk — may default or error
- Empty text input — may return zero or error
- Very mixed-language content may produce imprecise range
- Network or payment failure returning 402/503

## How this service works

Rough LLM token estimate of text from characters and words, as a low-high range by content type. Not a tokenizer.

## Output

Returns a JSON object with tokensLow, tokensMid, and tokensHigh (the estimated token range), plus supporting metadata: character count, byte count, word count, the characters-per-token ratios assumed, the content kind used, a human-readable summary and disclaimer, and optional reasons or degraded/notChecked flags if the estimate quality is limited.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "kind": {
       "type": "string",
       "description": "english (default), code, or cjk, which changes the characters-per-token assumption"
      },
      "text": {
       "type": "string",
       "description": "The text to estimate (up to 20000 characters)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "kind": {
       "type": [
        "null",
        "string"
       ]
      },
      "bytes": {
       "type": [
        "null",
        "number"
       ]
      },
      "words": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "tokensLow": {
       "type": [
        "null",
        "number"
       ]
      },
      "tokensMid": {
       "type": [
        "null",
        "number"
       ]
      },
      "characters": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "tokensHigh": {
       "type": [
        "null",
        "number"
       ]
      },
      "charactersPerTokenAssumed": {
       "type": [
        "array",
        "n
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/llm-cost-capacity-calc-token-estimator-768f1afc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from llm-cost-calc.x402tookit.com](https://www.zero.xyz/host/llm-cost-calc.x402tookit.com/llms.txt)
