{"uid":"cap_HxP9tO0Fg9lJuuG1fFRd-","slug":"lordevo-token-count-estimate-94e18405","name":"Lordevo Token Count Estimate","description":"Token count estimate (plus characters, words, bytes): Estimates how many LLM tokens a text uses with a documented offline heuristic (not an exact tokenizer; typically within about 15% for English), with a low/high range, characters, words, lines and UTF-8 bytes. Input: text (POST for long text). Lim","url":"https://shop.lordevo.com/api/quick/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":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"Plain text or Markdown, 1-400,000 characters (short text in the query; long text as POST JSON {\"text\": \"...\"})"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["tool","tokens_estimate","is_estimate"],"properties":{"tool":{"type":"string"},"lines":{"type":"integer"},"range":{"type":"object"},"words":{"type":"integer"},"method":{"type":"string"},"bytes_utf8":{"type":"integer"},"characters":{"type":"integer"},"chars_div_4":{"type":"integer"},"is_estimate":{"type":"boolean"},"tokens_estimate":{"type":"integer"}}}}}}},"responseSchema":null,"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_gRxCoOLZ3VNmJb-NPYr6Y","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":"Estimates the number of LLM tokens in a given text using an offline heuristic, returning a token estimate with low/high range, plus character, word, line, and byte counts.","exampleAgentPrompt":"How many LLM tokens would this text use: 'Large language models process text by breaking it into tokens, which are chunks of characters roughly corresponding to words or word-pieces. Understanding token counts is essential for managing API costs and context window limits.'","exampleUseCases":[{"title":"Prompt length budget check","prompt":"Before I send this system prompt to GPT-4, can you estimate how many tokens it uses? Here's the text: 'You are a helpful assistant specialized in customer support for an e-commerce platform. Always respond politely and escalate issues involving refunds to a human agent.'"},{"title":"Document fits in context window","prompt":"I have this article draft and I need to know if it fits within a 4,000-token context window — can you estimate the token count for it? The text is: 'Artificial intelligence is transforming industries at an unprecedented pace. From healthcare to finance, organizations are deploying machine learning models to automate tasks, improve decision-making, and uncover insights hidden in vast datasets.'"},{"title":"Cost estimation before API call","prompt":"I'm about to send a batch of user messages to an LLM API and want to estimate my costs — can you tell me the token count for this sample message: 'Please summarize the following quarterly earnings report in three bullet points, highlighting revenue growth, net income changes, and any forward guidance provided by management.'"}],"resultDescription":"Returns a JSON object with: tokens_estimate (integer), a range object with low and high token estimates, characters (character count), words (word count), lines (line count), bytes_utf8 (UTF-8 byte count), chars_div_4 (characters divided by 4), is_estimate (boolean flag indicating this is an approximation), method (name of the heuristic used), and tool (identifier of the estimation tool).","failureModes":["Missing 'text' query parameter returns an error","Text exceeding 400,000 characters may be rejected or truncated","Very short or empty text may return near-zero estimates","Non-UTF-8 encoded input may cause byte count inaccuracies","Heuristic can be off by up to ~15% for non-English or code-heavy text","Network timeout if the service is unavailable"],"whenToPreferThis":"Choose this endpoint when you need a fast, low-cost, offline-heuristic token count without calling an actual LLM tokenizer. It is ideal for pre-flight checks before LLM API calls, cost estimation, context window validation, or any situation where approximate token counts (within ~15% for English) are sufficient. Prefer it over LLM-native tokenizer APIs when latency and cost matter more than exact precision.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:41:30.593Z","isFirstParty":false,"canonicalSlug":"lordevo-token-count-estimate-94e18405"}