{"slug":"tokens-openverbs-com-v1-count-860684","title":"Count the LLM tokens in text for a given model or encoding — exact for OpenAI an","host":"tokens.openverbs.com","method":"POST","resource":"https://tokens.openverbs.com/v1/count","category":"market","description":"Count the LLM tokens in text for a given model or encoding — exact for OpenAI and open models (Llama, Mistral, Qwen, Gemma, DeepSeek, Command-R); labelled-approximate for Claude & Gemini.","price_listed":0.004,"price_asked":0.004,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":607,"reported_calls_30d":4,"reported_payers_30d":2,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"encoding":"o200k_base","model":"example","text":"example"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"encoding":{"description":"Explicit OpenAI BPE encoding. Overrides \"model\" and is always exact. Defaults to o200k_base.","enum":["o200k_base","cl100k_base","p50k_base","r50k_base"],"type":"string"},"model":{"description":"LLM model name, e.g. \"gpt-4o\", \"llama-3.1-70b\", \"claude-3-5-sonnet\". Resolved to its tokenizer. Defaults to gpt-4o. Supported families: o200k_base, cl100k_base, p50k_base, r50k_base, llama3, llama2, mistral, qwen, gemma, deepseek, command-r, claude, gemini.","maxLength":100,"minLength":1,"type":"string"},"text":{"description":"The text to tokenize. Empty string counts as 0 tokens.","maxLength":100000,"type":"string"}},"required":["text"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.004,"price_match":true,"latency_ms":607,"error":null}],"description_full":"Count the LLM tokens in text for a given model or encoding — exact for OpenAI and open models (Llama, Mistral, Qwen, Gemma, DeepSeek, Command-R); labelled-approximate for Claude & Gemini.","last_updated":"2026-09-14T20:00:06.977Z","schemes":["exact"]}