Token Counter & Cost Calculator forLLM APIs
Compare token usage and pricing across OpenAI, Anthropic, Google, Mistral, AWS Bedrock, and many more. Estimate project costs before you write a single line of code.
Calculate Your Token Costs
Follow the steps below to get accurate cost estimates for your LLM usage
100% Private: All calculations happen in your browser. Your text is never sent to any server or stored anywhere.
Enter your prompt text or the number of input tokens you expect to send to the model.
Enter an example response or the expected number of output tokens from the AI.
Some providers (like OpenAI, Anthropic) offer discounted pricing for cached/repeated tokens. If you use prompt caching, enter the cached portion here for more accurate cost estimates.
Cached tokens are typically charged at 50-90% discount. Leave at 0 if you don't use caching.
Average length of AI response
Mistral | Cost optimized for your usage
Model Comparison Matrix
Ministral 3B | Mistral | 128K | $0.040 | $0.040 | $0.00002000 | $0.6000 |
Llama 3.1 8B (Groq) | Groq | 128K | $0.050 | $0.080 | $0.00004000 | $1.20 |
Ministral 8B | Mistral | 128K | $0.100 | $0.100 | $0.00005000 | $1.50 |
Nova Micro | AWS Bedrock | 128K | $0.035 | $0.140 | $0.00007000 | $2.10 |
Titan Text Lite | AWS Bedrock | 4K | $0.150 | $0.200 | $0.000100 | $3.00 |
Qwen 2.5 32B | Qwen | 128K | $0.150 | $0.200 | $0.000100 | $3.00 |
Qwen 2.5 Coder 32B | Qwen | 128K | $0.150 | $0.200 | $0.000100 | $3.00 |
Nova LitePopular | AWS Bedrock | 300K | $0.060 | $0.240 | $0.000120 | $3.60 |
Mixtral 8x7B (Groq) | Groq | 32K | $0.240 | $0.240 | $0.000120 | $3.60 |
DeepSeek Coder V2 | DeepSeek | 128K | $0.140 | $0.280 | $0.000140 | $4.20 |
Gemini 3.1 FlashPopular | 1.0M | $0.075 | $0.300 | $0.000150 | $4.50 | |
Gemini 3 FlashPopular | 1.0M | $0.075 | $0.300 | $0.000150 | $4.50 | |
Gemini 2.5 Flash | 1.0M | $0.075 | $0.300 | $0.000150 | $4.50 | |
Llama 4 ScoutPopular | Meta | 1.0M | $0.100 | $0.300 | $0.000150 | $4.50 |
GPT-5 Nano | OpenAI | 128K | $0.050 | $0.400 | $0.000200 | $6.00 |
GPT-4.1 Nano | OpenAI | 1.0M | $0.100 | $0.400 | $0.000200 | $6.00 |
Gemini 2.0 FlashPopular | 1.0M | $0.100 | $0.400 | $0.000200 | $6.00 | |
Qwen 2.5 72BFlagship | Qwen | 128K | $0.350 | $0.400 | $0.000200 | $6.00 |
Jamba 1.5 Mini | AI21 | 256K | $0.200 | $0.400 | $0.000200 | $6.00 |
GPT-4o MiniPopular | OpenAI | 128K | $0.150 | $0.600 | $0.000300 | $9.00 |
Mistral SmallPopular | Mistral | 32K | $0.200 | $0.600 | $0.000300 | $9.00 |
Titan Text ExpressPopular | AWS Bedrock | 8K | $0.200 | $0.600 | $0.000300 | $9.00 |
QwQ 32B | Qwen | 32K | $0.150 | $0.600 | $0.000300 | $9.00 |
Llama 4 MaverickFlagship | Meta | 1.0M | $0.200 | $0.600 | $0.000300 | $9.00 |
Llama 3.3 70B | Meta | 128K | $0.590 | $0.790 | $0.000395 | $11.85 |
Llama 3.3 70B (Groq)Popular | Groq | 128K | $0.590 | $0.790 | $0.000395 | $11.85 |
Titan Multimodal | AWS Bedrock | 8K | $0.800 | $0.800 | $0.000400 | $12.00 |
Codestral | Mistral | 32K | $0.300 | $0.900 | $0.000450 | $13.50 |
DeepSeek V3Popular | DeepSeek | 64K | $0.270 | $1.10 | $0.000550 | $16.50 |
Titan Text PremierFlagship | AWS Bedrock | 32K | $0.500 | $1.50 | $0.000750 | $22.50 |
Command RPopular | Cohere | 128K | $0.500 | $1.50 | $0.000750 | $22.50 |
GPT-4.1 MiniPopular | OpenAI | 1.0M | $0.400 | $1.60 | $0.000800 | $24.00 |
GPT-5 MiniPopular | OpenAI | 128K | $0.250 | $2.00 | $0.001000 | $30.00 |
DeepSeek R1Flagship | DeepSeek | 64K | $0.550 | $2.19 | $0.001095 | $32.85 |
Nova 2 Lite | AWS Bedrock | 1.0M | $0.300 | $2.50 | $0.001250 | $37.50 |
Nova ProFlagship | AWS Bedrock | 300K | $0.800 | $3.20 | $0.001600 | $48.00 |
Claude 3.5 HaikuPopular | Anthropic | 200K | $0.800 | $4.00 | $0.002000 | $60.00 |
Qwen VL Max | Qwen | 32K | $2.00 | $4.00 | $0.002000 | $60.00 |
o4-miniPopular | OpenAI | 200K | $1.10 | $4.40 | $0.002200 | $66.00 |
o3-mini | OpenAI | 200K | $1.10 | $4.40 | $0.002200 | $66.00 |
o1-mini | OpenAI | 128K | $1.10 | $4.40 | $0.002200 | $66.00 |
Gemini 3.1 ProFlagship | 2.0M | $1.25 | $5.00 | $0.002500 | $75.00 | |
Gemini 3 ProFlagship | 2.0M | $1.25 | $5.00 | $0.002500 | $75.00 | |
Gemini 2.5 Pro +1 | 2.0M | $1.25 | $5.00 | $0.002500 | $75.00 | |
Codex Mini | OpenAI | 200K | $1.50 | $6.00 | $0.003000 | $90.00 |
Mistral LargeFlagship | Mistral | 128K | $2.00 | $6.00 | $0.003000 | $90.00 |
Pixtral Large | Mistral | 128K | $2.00 | $6.00 | $0.003000 | $90.00 |
Grok 2 Mini | xAI | 128K | $2.00 | $6.00 | $0.003000 | $90.00 |
GPT-4.1 | OpenAI | 1.0M | $2.00 | $8.00 | $0.004000 | $120.00 |
Jamba 1.5 LargeFlagship | AI21 | 256K | $2.00 | $8.00 | $0.004000 | $120.00 |
GPT-5.1 | OpenAI | 200K | $1.25 | $10.00 | $0.005000 | $150.00 |
GPT-5Flagship | OpenAI | 200K | $1.25 | $10.00 | $0.005000 | $150.00 |
GPT-4o | OpenAI | 128K | $2.50 | $10.00 | $0.005000 | $150.00 |
Command R+Flagship | Cohere | 128K | $2.50 | $10.00 | $0.005000 | $150.00 |
GPT-5.2Flagship | OpenAI | 200K | $1.75 | $14.00 | $0.007000 | $210.00 |
GPT-5.4Flagship | OpenAI | 272K | $2.50 | $15.00 | $0.007500 | $225.00 |
Claude 4.6 SonnetPopular +1 | Anthropic | 200K | $3.00 | $15.00 | $0.007500 | $225.00 |
Claude 4 Sonnet +1 | Anthropic | 200K | $3.00 | $15.00 | $0.007500 | $225.00 |
Claude 3.7 Sonnet +2 | Anthropic | 200K | $3.00 | $15.00 | $0.007500 | $225.00 |
Claude 3.5 SonnetPopular +1 | Anthropic | 200K | $3.00 | $15.00 | $0.007500 | $225.00 |
Grok 2Flagship | xAI | 128K | $5.00 | $15.00 | $0.007500 | $225.00 |
Nova 2 ProFlagship | AWS Bedrock | 1.0M | $2.19 | $17.50 | $0.008750 | $262.50 |
o3Flagship | OpenAI | 200K | $10.00 | $40.00 | $0.0200 | $600.00 |
o1 | OpenAI | 200K | $15.00 | $60.00 | $0.0300 | $900.00 |
Claude 4.6 OpusFlagship | Anthropic | 200K | $15.00 | $75.00 | $0.0375 | $1.13K |
Claude 4 OpusFlagship | Anthropic | 200K | $15.00 | $75.00 | $0.0375 | $1.13K |
Claude 3 Opus | Anthropic | 200K | $15.00 | $75.00 | $0.0375 | $1.13K |
o3 ProFlagship | OpenAI | 200K | $20.00 | $80.00 | $0.0400 | $1.20K |
GPT-5.4 ProFlagship | OpenAI | 272K | $30.00 | $180.00 | $0.0900 | $2.70K |
How Token Pricing Works
Understanding token-based billing helps you make smarter decisions about which models to use for your applications.
Token Counting
LLM providers charge based on the number of tokens processed. Tokens are pieces of text - roughly 4 characters or 0.75 words on average.
Input vs Output Tokens
Input tokens are what you send to the model (prompts, context). Output tokens are the generated response. Each has different pricing.
Cached Tokens
Some providers (OpenAI, Anthropic) offer discounted rates for repeated prompts via caching. Cached tokens can cost 50-90% less than regular input tokens.
Tiered Pricing
Different models have vastly different costs. Flagship models like GPT-4o cost more than efficient alternatives like GPT-4o-mini.
Cost Optimization
By comparing costs across providers, you can save 10-90% on your LLM spending without sacrificing quality for your use case.
The Calculation Formula
Rates are typically expressed per 1 million tokens (1M). Our calculator automatically applies the correct rates for each provider and multiplies by your expected usage volume. When cached tokens are available, they replace a portion of your input tokens at a discounted rate.
About Cached Tokens
Cached tokens are input tokens that the provider has seen before in your conversation or system prompt. OpenAI and Anthropic offer significant discounts (50-75% off) for these tokens. Not all models support caching - check the model comparison table to see which ones do.
Pro Tip
You can paste both your input prompt AND an example output response to get accurate token counts for both. This gives you the most precise cost estimate for your specific use case.