LLM API Cost Calculator
Estimate what your AI API will cost across GPT, Claude, Gemini and more. Enter your tokens, see the price per call, monthly projection, and which model is cheapest.
Pick a model and enter your input and output tokens per request. See the cost per call and total, project it monthly or yearly, and compare every model for the same workload.
| Model | In $/1M | Out $/1M | Total |
|---|
What is an LLM API Cost Calculator?
An llm api cost calculator converts the tokens you send and receive into a clear dollar estimate. Enter average input and output tokens per request and the number of requests; the tool applies each model's input/output rates (priced per million tokens) to show cost per request, monthly and yearly projections, and a side‑by‑side model ranking so you can see which model is cheapest for your exact workload. Assumptions: this view treats prices as pay‑as‑you‑go per‑million‑token rates and does not include subscriptions, enterprise contracts, network or storage fees, or automatic provider discounts unless you adjust them manually. For an accurate estimate, measure representative prompts with a token counter and use those averages here.
Whether you're budgeting a new AI feature, comparing providers before committing, or trying to cut an existing API bill, knowing the real cost per call and at scale is essential. A model that looks cheap per token can become expensive at volume, and the cheapest model isn't always obvious until you run the numbers.
How is LLM API Cost Calculated?
The cost of a single request is: Cost_per_request = (Input_tokens × Input_price_per_million + Output_tokens × Output_price_per_million) / 1,000,000. Multiply that by the number of requests to get the total for a period. Example: if a request uses 500 input tokens and 1,000 output tokens and the model charges $2 per million input tokens and $8 per million output tokens, the request costs ((500×2)+(1000×8))/1,000,000 = $0.009. Multiply by daily/monthly request volume for projections. The calculator runs this arithmetic for every model and displays the input/output cost split, cost per call, and monthly/yearly totals so you can compare alternatives quickly.
(input tokens ÷ 1,000,000 × input price)
+ (output tokens ÷ 1,000,000 × output price)
Total = cost per request × number of requests
Example: 1,000 in + 500 out on GPT-4o
= (1000/1M × $2.50) + (500/1M × $10)
= $0.0025 + $0.005 = $0.0075 per call
How to Use This Calculator
Choose your model, then enter the average input tokens and output tokens for a single request — if you're not sure, use a token counter on a sample prompt and response. Enter how many requests you expect, and pick whether that's a one-off total, a daily figure, or a monthly figure. You'll instantly see the cost per request, the total, the input/output split, and monthly and yearly projections. The comparison table shows the same workload priced on every model, cheapest first.
Why Output Tokens Cost More
Across almost every provider, output tokens are priced higher than input tokens — commonly three to five times more. This is because generating text is more computationally expensive than reading it. The practical consequence is that the length of the model's responses often drives your bill more than the length of your prompts. If your costs are high, capping the maximum output length and asking for concise responses is frequently the biggest lever you have.
Comparing GPT vs Claude vs Gemini Costs
Pricing varies widely across providers and tiers. Budget models like Gemini Flash-Lite or GPT-4o mini cost a fraction of flagship models like GPT-5.5 or Claude Opus. The comparison table makes the trade-off visible: for the same workload, the cheapest and most expensive models can differ by 50x or more. The key insight is that you rarely need the most powerful (and priciest) model for every task — routing simple work to a cheap model and reserving the flagship for hard cases is the single biggest way to control costs.
What is a Token?
A token is the unit LLMs read and bill in — roughly four characters or three-quarters of a word in English. Both your prompt and the model's response are measured in tokens. Because billing is per token, accurately estimating your token counts is the foundation of cost estimation. To get exact token counts for your actual prompts, use a token counter tool, then plug those numbers into this calculator for a precise cost.
Ways to Reduce Your API Costs
- Use cheaper models for simple tasks: route classification, extraction, and routing to budget models; reserve flagships for complex reasoning.
- Cap output length: set a max-tokens limit so responses don't run longer (and pricier) than needed.
- Use prompt caching: most providers offer up to 90% off repeated input context.
- Batch non-urgent work: batch APIs typically give 50% off when you can wait.
- Trim prompts: remove redundant instructions and unnecessary context.
Understanding Pricing Tiers and Discounts
The prices in this calculator use standard pay‑as‑you‑go per‑million‑token rates and do not apply provider discounts automatically. Common savings omitted by default include: batch processing (often around 50% off for non‑urgent bulk jobs), prompt caching (can reduce repeated input token charges by up to 90%), and free tiers available on some models. Some flagship models may also add surcharges for very long prompts or special features. To budget precisely at scale, estimate your prompt reuse and batch patterns, then apply those discount multipliers to the calculator's output to produce an adjusted, real‑world cost estimate.
Frequently Asked Questions
Sources & References
Thank you for reading this post, don't forget to subscribe!Calculations verified against authoritative sources: OpenAI — Pricing · Anthropic — Pricing
Explore All NerdyTools By Categories
Find the right tool for any task — free, fast, and no sign-up required
