Count the number of tokens in a text string using the specified tokenizer encoding. Supports cl100k_base (GPT-4/GPT-3.5, exact BPE), o200k_base (GPT-4o, exact BPE), claude (Claude models, estimated), and gemini (Gemini models, estimated). Use before sending text to an LLM to estimate cost, check context window fit, or enforce token budgets. For base64-encoded images, set content_type='image' for tile-based token estimation. Send {"text": "...", "encoding": "cl100k_base"}. Max 50 MB text.
| Network | Scheme | Amount | Pay To |
|---|---|---|---|
| Base | exact | $0.003000 USDC | 0x7e67...13a4 |
| solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | exact | 0.00 tokens | GXTcDu...c9zM |
Loading activity for 2 addresses...
| Network | Address | USDC Balance | ETH Balance | Tx Count |
|---|---|---|---|---|
| Base | 0x7e67...13a4 | $8.70 | 0.000000 ETH | 1 |
| solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | GXTcDu...c9zM | — | error | — |