Token Cost Explained: What You're Actually Paying For
A plain-English guide to AI tokens, how they're counted, and exactly how to calculate your real costs.
This page is periodically reviewed to reflect current pricing and plan changes.
What Is a Token?
A token is roughly 0.75 words — or about 4 characters of English text. Tokenization is how AI models process text: they convert words into numerical tokens before processing.
Examples: - "The quick brown fox" = ~4 tokens - "Hello, world!" = 3 tokens - A typical short email = 100-200 tokens - A 1000-word blog post = ~750 tokens
Token counts vary by model. GPT models use the tiktoken library; Claude uses a similar approach. Non-English text, code, and symbols often tokenize less efficiently.
Input vs Output Tokens
AI APIs charge separately for input (what you send) and output (what the model returns).
Input tokens: your system prompt + conversation history + user message Output tokens: the model's response
Output tokens almost always cost more — typically 3-5x more per token than input. This is why long, verbose AI responses cost significantly more than short ones.
GPT-4o example: - Input: $5 per 1M tokens - Output: $15 per 1M tokens - A 1000-token response costs $0.015 — less than 2 cents
How to Calculate Monthly Cost
Monthly cost = (Input tokens × input price) + (Output tokens × output price)
Example calculation: - You send 500 requests/day, each with 500 input tokens and 200 output tokens - Monthly input: 500 × 500 × 30 = 7.5M tokens × $0.005/1K = $37.50 - Monthly output: 500 × 200 × 30 = 3M tokens × $0.015/1K = $45 - Total: $82.50/month with GPT-4o
Same workload with GPT-4o mini: - Monthly input: 7.5M × $0.00015/1K = $1.13 - Monthly output: 3M × $0.0006/1K = $1.80 - Total: $2.93/month — 97% cheaper
OpenAI API — pay-per-token, no surprises
Once you understand token pricing, OpenAI's per-1K rates make it easy to budget exactly. GPT-4o mini at ~$0.15/M input tokens is the cheapest serious workhorse model right now.
Context Window and Why It Matters for Cost
Every AI model has a context window — the maximum number of tokens it can process at once. Models like Gemini 1.5 Pro support 2M tokens; GPT-4o supports 128K.
For cost: longer context windows mean you can send more history per request — which increases input token count and cost. If you're sending full conversation history with every request, costs compound quickly.
Optimization: Only send the last N messages of history, not the full conversation. Summarize older context instead of including raw text.
Cached Tokens and Discounts
Anthropic and OpenAI both offer prompt caching — re-using expensive prompt processing for identical prefixes. Cached input tokens cost significantly less:
- OpenAI cached tokens: ~50% discount on input
- Anthropic cached tokens: up to 90% discount on input
If you have a large system prompt that doesn't change between requests, caching it can dramatically cut costs. Most production applications should enable caching by default.
Key Takeaways
- →1 token ≈ 0.75 words ≈ 4 characters of English text
- →Output tokens cost 3-5x more than input tokens on most models
- →Monthly cost = (input tokens × input price) + (output tokens × output price)
- →Reduce costs by shortening prompts, truncating history, and caching repeated prefixes
- →Use our calculator for a precise estimate based on your actual usage patterns
Editorial context
Who is this for?
Developers, startups, and teams who want to reduce their AI API or subscription costs without sacrificing quality.
When NOT to use this
Users who need real-time data, image generation, or proprietary enterprise integrations may need more specialised tools.
Pricing insights
AI pricing varies widely — some models charge per token while others use flat subscriptions. Token-based APIs are usually cheaper for moderate usage, while subscriptions suit power users with high and consistent volume.
Alternatives to consider
Consider DeepSeek V3 for cost-effective coding and writing, Gemini Flash for fast tasks, or Claude Haiku for lightweight structured work. Use the calculator to compare your specific usage.
Final verdict
The cheapest AI tool is the one that fits your exact workload. Use the cost calculator and decision engine on this site to find your optimal stack — most users can cut AI spend by 50% or more.