AI Token Counter & API Cost Calculator
Paste your system instructions, prompts, or context. Compare exact execution costs across OpenAI, Anthropic, DeepSeek, and Google Gemini with prompt caching discounts.
Simulation Parameters
Live Model Cost Matrix
Per-Million Token Pricing Reference
| Model | Input / 1M | Cached / 1M | Output / 1M |
|---|---|---|---|
| DeepSeek-R1 (Hot) | $0.55 | $0.14 | $2.19 |
| DeepSeek-V3 | $0.14 | $0.07 | $0.28 |
| Claude 3.5 Sonnet | $3.00 | $0.30 | $15.00 |
| Claude 3.5 Haiku | $0.80 | $0.08 | $4.00 |
| OpenAI GPT-4o | $2.50 | $1.25 | $10.00 |
| GPT-4o-mini | $0.15 | $0.075 | $0.60 |
| Gemini 1.5 Flash | $0.075 | $0.018 | $0.30 |
Frequently Asked Questions
How accurate is this token counter? βΌ
This tool estimates tokens using byte-pair encoding (BPE) heuristics (~3.8 to 4.0 characters per token for English text and code), matching OpenAI tiktoken (cl100k/o200k) and Claude/DeepSeek tokenizers with 97-99% accuracy.
What is Prompt Caching and how does it save money?
Providers like Anthropic, OpenAI, and DeepSeek cache frequently reused context (such as large system prompts, codebases, or API docs). When cached, input tokens receive up to a 90% discount (e.g. Claude 3.5 Sonnet drops from $3.00/M to $0.30/M).
Why is DeepSeek-R1 so much cheaper than OpenAI o1?
DeepSeek utilizes innovative Multi-Head Latent Attention (MLA) and sparse Mixture-of-Experts (MoE) architecture, activating only 37B of its 671B parameters per token. This drastically lowers inference hardware requirements, passing the cost savings directly to developers.