{"uid":"cap_o0uY9RjRZOt1rFAsm1fDO","slug":"moneytools-token-counter-b6bb6557","name":"MoneyTools Token Counter","description":"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.","url":"https://tools.moneytools.dev/v1/token-count?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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}}}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_3LIDHdtyQlfUoVhyAHWOX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Counts the number of tokens in a given text string using LLM tokenization","exampleAgentPrompt":"How many tokens is the sentence 'The quick brown fox jumps over the lazy dog'?","exampleUseCases":[{"title":"Pre-flight prompt token check","prompt":"Before I send this 3-paragraph prompt to GPT-4, can you tell me how many tokens it is so I know if it fits in the context window?"},{"title":"Cost estimation for LLM API call","prompt":"I'm about to send this document as input to an LLM API — count the tokens so I can estimate the cost before submitting."},{"title":"Validating chatbot message length","prompt":"My chatbot system prompt is getting long — can you count exactly how many tokens it uses so I can trim it if needed?"}],"resultDescription":"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).","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-03T06:39:29.148Z","isFirstParty":false,"canonicalSlug":"moneytools-token-counter-b6bb6557"}