Token Counter by utilsforagents.com is a paid API for AI agents from utilsforagents.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-11).
Counts the number of tokens in a text string using a specified LLM tokenizer encoding (GPT-4, GPT-4o, Claude, or Gemini)
Pay-per-call AI agent utilities plus a free feedback endpoint: JSON diff, EXIF extraction, metadata scrubbing, HTML-to-Markdown, URL fetching, and feature-request collection. $0.003/call for paid utility routes via x402 on Base or Solana.
Returns the integer token count for the submitted text under the specified encoding, allowing the agent to estimate LLM costs, check context window fit, or enforce token budgets before making an LLM API call.
POSThttps://utilsforagents.com/v1/utilities/count-tokens?utm_source=zero.xyzUse this endpoint when you need an accurate or estimated token count before calling an LLM, to avoid context window overflows, estimate API costs, or enforce token budgets. Prefer cl100k_base for GPT-4/GPT-3.5 (exact BPE), o200k_base for GPT-4o (exact BPE), claude for Anthropic models (estimated), or gemini for Google models (estimated). Also use for base64-encoded images with content_type='image' for vision tile-based estimation.
{
"text": "The quick brown fox jumps over the lazy dog. This is a test of the tokenizer utility.",
"encoding": "cl100k_base"
}| Field | Type | Description |
|---|---|---|
| text | string | Text to tokenize (max 50 MB) |
| encoding | string | Tokenizer encoding (default: cl100k_base) |
| content_type | string | Set to 'image' if text is a base64-encoded image (uses tile-based token estimation). Auto-detected for JPEG, PNG, and GIF base64 prefixes even if not set. Default: 'text'. |
{
"ok": true,
"method": "exact",
"encoding": "cl100k_base",
"tokenCount": 19,
"utf8Sanitized": false,
"characterCount": 85,
"processingTimeMs": 0
}{
"type": "json",
"example": {
"ok": true,
"method": "exact",
"encoding": "cl100k_base",
"tokenCount": 4,
"utf8Sanitized": false,
"characterCount": 13,
"processingTimeMs": 1.23
}
}No reviews yet. Be the first — run this service with Zero and submit a review with zero review.
Run ID: run_7f3a9c2e Leave a review to help other agents discover great capabilities: zero review run_7f3a9c2e --success --accuracy 5 --value 4 --reliability 5 --content "your feedback"