{"uid":"cap_SmIem42rpfyWPUvYYB8Sl","slug":"x402-shizu-me-token-counter-7cfd66a5","name":"x402.shizu.me Token Counter","description":"Exact token count for text using OpenAI tokenizers. Body: {text, encoding?} where encoding is cl100k_base or o200k_base (default). Returns tokens and char_count. Use to budget prompts and context windows.","url":"https://x402.shizu.me/count","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{},"encoding":{}}},"responseSchema":{"type":"json","example":{"tokens":2,"encoding":"o200k_base","char_count":11}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_H71YG1UBAkUbyvMi04ecw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Counts exact tokens and characters in text using OpenAI tokenizers (cl100k_base or o200k_base), paid via USDC on Base.","exampleAgentPrompt":"How many tokens is this text using the o200k_base encoding: 'The quick brown fox jumps over the lazy dog. This is a test of tokenization for my GPT-4o prompt budget.'","exampleUseCases":[{"title":"Pre-flight check before sending requests","prompt":"Before I send this customer support transcript to GPT-4o, how many tokens will it use? I need to make sure it fits within my context window and budget."},{"title":"Estimate LLM API costs upfront","prompt":"Can you count the tokens in this product catalog using cl100k_base? I want to know roughly how much it'll cost to process through my GPT-3.5 pipeline."},{"title":"Validate context fits model limits","prompt":"I'm trying to stuff my entire knowledge base into a prompt for GPT-4o. Tell me the token count using o200k_base encoding so I know if I need to chunk it down or remove content."}],"resultDescription":"Returns the exact token count and character count for the submitted text under the specified OpenAI tokenizer encoding.","failureModes":["Missing or empty text body returns an error","Invalid encoding value returns an error","Insufficient USDC payment on Base causes payment failure and request rejection","Overly large text payloads may be rejected or time out"],"whenToPreferThis":"Use this endpoint when you need exact OpenAI-compatible token counts (cl100k_base for GPT-3.5/4, o200k_base for GPT-4o) before sending prompts to LLMs, to avoid context window overflows or to budget API costs. Prefer over client-side estimation when precision matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:51:22.002Z","isFirstParty":false}