Business
Instant, private, and free
AI Token Cost Calculator.
Estimate API pricing for popular LLM models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek, with support for batch calls and agent loops.
Set your values
Results update as you type.
Estimate Tokens from Text
API Cost Estimates
Cost per Run
$0.0210
Cost per Selected Period
$2.10
Total Tokens per Run
Daily Cost
$0.07
10,000 tokens/day
Monthly Cost
$2.10
300,000 tokens/mo
Yearly Cost
$25.55
3,650,000 tokens/yr
Budget Longevity
Total runs allowed within budget
4,761 runs
Your budget will last for about 47.6 months
Model Cost Comparison (per Run)
FAQs
How are LLM API costs calculated?
API costs are calculated based on the number of prompt (input) tokens and completion (output) tokens, multiplied by the model's rate per million tokens.
What is a token?
A token is a basic unit of text, representing about 4 characters or 0.75 words. For example, 100 tokens is approximately 75 words.
Why do AI agents consume more tokens?
AI agents operate in loops, appending previous turn history to the prompt of the next turn. This context expansion means input tokens scale quadratically, increasing costs per run.
How does the budget longevity estimate work?
The calculator takes your monthly budget and divides it by the cost of your simulated usage, giving you the total runs and days your budget will last.
Cite this calculator
Canonical URL: https://mathify.one/en/business/ai-pricing
Cite as: Mathify. (2026). AI Token Cost Calculator. https://mathify.one/en/business/ai-pricing
Use Cases
Estimate per-request API costs
For a single API call, enter the model's pricing and your token usage to see the cost of one request. Useful for budgeting individual features or comparing models.
Example: Input: 5,000 tokens, Output: 1,000 tokens, Input price $3/M, Output price $15/M → cost $0.03
Simulate AI agent loop expenses
Model an agent that makes multiple turns, each adding tokens to the context. The calculator simulates context expansion and estimates total tokens and cost for the entire loop.
Example: Initial prompt 2,000 tokens, 10 turns, +500 tokens/turn, output 200 tokens/turn → see total cost
Frequently Asked Questions
- How does the AI Token Cost Calculator estimate API costs?
- You input the input and output prices per 1M tokens, along with token counts for prompt and completion. The calculator multiplies these to give a per-request cost. For agent loops, it uses initial prompt tokens, tokens added per turn, and output tokens per turn to simulate context expansion and compute total token usage.
- Can I use this calculator for custom AI models?
- Yes. The calculator includes a 'Custom Model' option where you can manually enter the input and output prices per 1M tokens, allowing you to estimate costs for any LLM API.
- What is the purpose of the 'Monthly Budget' field?
- The Monthly Budget field lets you set a spending limit. The calculator can compare your estimated monthly expenses against this budget, helping you see if your projected usage stays within your planned spending.
Tips & Common Mistakes
Tips
- Check your model's current pricing page for accurate input and output prices per 1M tokens, as they can change.
- For agent loops, estimate the average tokens added per turn based on your use case (e.g., tool results, memory).
- Use the Monthly Budget field to set a cap and adjust your request volume or frequency to stay within budget.
- Remember that some models have different pricing for cached input tokens; this calculator uses standard rates.
Common Mistakes to Avoid
- Forgetting to convert prices to per 1M tokens: if your price is per 1K tokens, multiply by 1000 before entering.
- Not accounting for the context expansion in agent loops: the calculator uses the 'Tokens Added per Turn' to simulate growth, so leaving it at 0 will underestimate costs.
- Confusing input and output token counts: ensure you enter the correct numbers for prompt and completion to get an accurate cost.
Last updated: August 13, 2026