# MoneyTools Token Counter

> MoneyTools Token Counter is a paid API for AI agents from tools.moneytools.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-12-03).

Counts the number of tokens in a given text string using LLM tokenization

## Facts

- Endpoint: GET https://tools.moneytools.dev/v1/token-count?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/moneytools-token-counter-b6bb6557
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_o0uY9RjRZOt1rFAsm1fDO

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 moneytools-token-counter-b6bb6557
```

Example prompt: How many tokens is the sentence 'The quick brown fox jumps over the lazy dog'?

## When to prefer this

Use this endpoint when you need a quick, cheap, read-only token count for any text string — especially when building LLM pipelines, estimating API costs, or validating that prompts fit within context windows. At $0.001 per call with a free daily tier, it's ideal for lightweight automation and agent workflows that need frequent token checks without maintaining a local tokenizer.

## Known failure modes

- Missing 'text' query parameter returns a 400 or validation error
- Empty string input may return 0 tokens or an error
- Exceeding free tier without valid x402 payment credentials results in a 402 Payment Required
- Very large text inputs may be truncated or rejected
- Network timeouts on slow connections

## How this service works

Catalog of MoneyTools: 116 cheap, read-only tools for AI agents. Free daily tier, then x402 USDC micropayments or prepaid credits. Token safety, approvals, tx decoding, EIP-712 risk, gas, ENS, x402 validation, DNS, RDAP, JSON Schema, time, FX.

## Output

A JSON object with the token count for the submitted text, plus payment metadata indicating whether the free tier was used or a micropayment was charged (amount in USDC, transaction hash if applicable).

## 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": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "examples": [
        "How many tokens is this sentence?"
       ],
       "description": "text"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "properties": {
      "payment": {
       "type": "object",
       "properties": {
        "charged": {
         "type": "boolean"
        },
        "network": {
         "type": "string"
        },
        "amountUsd": {
         "type": "string"
        },
        "transaction": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      },
      "freeTier": {
       "type": "object"
      },
      "_moneytools": {
       "type": "object",
       "description": "optional plan / partner hints"
      }
     },
     "description": "Tool-specific JSON result (see llms.txt / openapi.json). Always includes payment info.",
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "range": {
   "low": 7,
   "high": 11
  },
  "words": 6,
  "method": "heuristic BPE-style estimate (±15% vs cl100k/o200k/Claude tokenizers); CJK ≈1 token per character",
  "characters": 33,
  "context_fit": {
   "1M": true,
   "8k": true,
   "32k": true,
   "128k": true,
   "200k": true
  },
  "tokens_estimate": 9
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/moneytools-token-counter-b6bb6557/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tools.moneytools.dev](https://www.zero.xyz/host/tools.moneytools.dev/llms.txt)
