Free AI API cost planning tool
AI Token Cost Calculator — Estimate LLM API Costs
Calculate how much an AI model API costs per request, month or year. Estimate spending for GPT, Claude, Gemini, DeepSeek or another LLM using input, output and cached-token pricing. Adjust request volume and retries to plan API budgets before deploying an AI agent or application.
How to use it: Choose a source-reviewed model preset or enter current provider rates, set tokens per request and monthly calls, then review the estimated API bill. All rates remain editable.
Your workload and model rates
Free • in-browserStart with an audited model rate, or enter your own
Source-reviewed October 30, 2026. Standard paid text/API rates only; not live quotes. Check the provider sources and exclusions before relying on a preset.
Review the three prices shown for your chosen model. The cached-input percentage starts at 0% because cache hits are workload-dependent. Pricing tiers, long contexts, cache writes, batch jobs, grounding and tools may cost extra.
Recommended next tools
Method: Results are calculations from the displayed assumptions—not measured usage or live provider invoices. Preset prices are dated snapshots, not automatic pricing updates.
How to Calculate AI API Token Costs
API text models generally bill for tokens sent into a request (input) and generated in its response (output). Cached input tokens can have a different read price. To estimate the cost of each call, divide the input and output token counts by one million and multiply by their respective USD rates.
Per call: (input tokens ÷ 1,000,000 × blended input rate) + (output tokens ÷ 1,000,000 × output rate)
Per month: cost per call × expected monthly calls × (1 + retry percentage ÷ 100)
Per year: estimated monthly cost × 12, assuming unchanged usage and pricing
Worked example: 10,000 monthly LLM requests
Suppose each request uses 2,000 input tokens and 500 output tokens. With illustrative rates of $2 per million input and $10 per million output, the input costs $0.004 and the output costs $0.005 per request. That is $0.009 per call, $90 per month at 10,000 calls, or $1,080 per year without retries or caching. Adding 10% extra billed calls makes the monthly estimate $99. These are hypothetical rates for arithmetic, not a quotation for any named provider.
GPT, Claude and Gemini API Pricing: Dated Reference Rates
The calculator presets below reflect specific published standard paid text/API rates checked October 30, 2026. All figures are USD per million tokens. Select a model above to populate editable rates, and compare the exact source before budgeting. For DeepSeek and models not listed, use the manual rate fields rather than assuming a price.
| Model and scope | Input | Output | Cached read | Official source |
|---|---|---|---|---|
| OpenAI GPT-5.4 Published standard API token rates. Other service modes and long-context pricing can differ. | $2.50 | $15.00 | $0.25 | Provider pricingChecked 2026-10-30 |
| Claude Sonnet 4.6 First-party global standard API. Cached rate is for cache reads only; cache writes are billed separately. | $3.00 | $15.00 | $0.30 | Provider pricingChecked 2026-10-30 |
| Gemini 2.5 Flash Paid-tier standard text input/output. Audio, cache storage and grounding can incur additional charges. | $0.30 | $2.50 | $0.03 | Provider pricingChecked 2026-10-30 |
Cache-read rates are not the same as cache-write or storage fees. Batch processing, regional routing, audio or image tokens, context tiers, search grounding and other tools can change your bill. The calculator does not claim live updates or total-price parity between providers.
How Much Does It Cost to Run an AI Agent?
An agent can call an LLM repeatedly to plan, use tools, interpret results and retry failed steps. Multiply each step's billable tokens by how often it happens, then add any model-independent charges. A single user task may involve several API requests, so estimate the total number of model calls, not just conversations or users.
Combine this token estimate with compute, networking and storage assumptions before comparing an API against self-hosting. Compare AI agent hosting costs.
When Prompt Caching Saves Money
If your workload repeatedly includes shared instructions or retrieved documents and your provider reports cache hits, enter the fraction of input tokens served at the discounted read price. A 50% cache hit share means half of the input tokens use the regular rate and half use the cached rate. This is a workload assumption—not a guaranteed discount.
Confirm eligibility and cache-write costs with your provider. If you cannot measure cache hits, keep the default at 0% for a more conservative estimate.
AI Token Cost Calculator FAQs
How do I calculate AI API token costs?
Multiply input tokens by the input price per million and output tokens by the output price per million, then add both. Multiply by your monthly API call volume and any estimated retry overhead. Cached input tokens can use a separate discounted read rate.
How much does one million AI tokens cost?
There is no universal cost. Each model and provider sets separate input and output rates, with possible discounts or surcharges for context size, caching, batch requests and data residency. Use the dated, linked reference rates or your account's current price list.
Can I estimate GPT, Claude, Gemini, or DeepSeek API spending?
Yes. This calculator works with any text LLM that publishes input and output token rates. It includes selected source-reviewed GPT, Claude and Gemini presets. For DeepSeek or another model, enter your provider's current rates manually; no unverified preset is supplied.
What do cached input tokens change?
If your provider discounts cache reads, enter the cached read rate and the percentage of input tokens actually served from cache. A zero cache percentage means all input is billed at the normal rate. Some providers also charge for cache writes or storage; add those separately.
Are API retries and agent loops included?
You can estimate additional billed requests with the retry percentage, but the calculator assumes each extra call consumes the same tokens as an ordinary call. For agents that invoke a model several times per task, count each call in your monthly volume and include tools or infrastructure charges separately.
Is this my exact provider invoice?
No. It is a planning estimate based on your selected or entered rates. It does not retrieve provider billing records or include all tool, retrieval, caching-storage, long-context, tax or hosting fees. Recheck the provider source before making a purchasing decision.
Agent Infrastructure Recommendation Kit
Turn your API estimate into an infrastructure decision
The $19 Recommendation Kit helps compare API-dependent and self-hosted approaches, document assumptions and build a decision brief.
Get the Recommendation Kit — $19