AI Token Tools
AI Token Cost Calculator — Estimate ChatGPT, Claude & Gemini API Cost
Estimate what an AI API call will cost. Paste your prompt to count input tokens, set the expected output and number of requests, and compare the estimated cost across models in one table.
- Cost formula
- (in × in-price + out × out-price) ÷ 1M × requests
- Pricing unit
- USD per 1M tokens
- Input tokens
- Counted from your prompt
- Note
- Prices approximate — verify with provider
About this tool
AI API pricing is charged per token, usually at a different rate for input (your prompt, plus system message and history) and output (the model's reply). To estimate spend you need the token counts and the per-model prices — this calculator combines both.
Paste a prompt to count input tokens automatically, set the output tokens you expect and how many requests you will make, and the table shows the estimated cost for each model. Prices change often, so always confirm the current rate with the provider before relying on a figure.
Output tokens usually cost more than input tokens, sometimes several times more, so the length of the model's answer can dominate your bill on chatty workloads.
How AI API pricing works
Providers publish a price per million tokens, split into an input rate and an output rate. Your cost for one call is (input tokens × input price + output tokens × output price) ÷ 1,000,000. Multiply by the number of requests for a batch or a monthly estimate.
Input vs output tokens
Input tokens are everything you send — prompt, system message, conversation history and any attachments. Output tokens are the model's response. Because output is often priced higher, capping the response length (max tokens) is one of the most effective ways to control cost.
How to lower your API bill
Choose a smaller or cheaper model where quality allows, shorten and summarise prompts, cache or reuse system messages, limit max output tokens, and batch requests. Counting tokens first makes each of these savings measurable.
How to use
- Add your prompt — Paste the prompt to auto-count input tokens, or type the number directly.
- Set output & requests — Enter expected output tokens and how many times you will call the API.
- Compare cost — Read the estimated cost for each model and pick the best fit.
- Plan your budget — Scale the request count up to project a daily or monthly bill.
Frequently asked questions
How is AI API cost calculated?
Cost = (input tokens × input price + output tokens × output price) ÷ 1,000,000 × requests. Input and output have separate per-million-token rates.
Are the prices current?
They are approximate and provided for comparison only. AI providers change pricing often — verify the latest rates before relying on them.
Why do I need to estimate output tokens?
You pay for the model's reply too, and output is often the larger cost. Estimating output length (e.g. 300–800 tokens for a short answer) makes the total realistic.
Which model is cheapest?
It depends on your input/output mix. Smaller models like GPT-4o mini, Gemini Flash and DeepSeek are usually the lowest cost; the table shows them side by side.
Does the calculator store my prompt?
No. Token counting runs in your browser and nothing is uploaded.