LLM API Cost Calculator
Estimate the cost of any LLM API call per request and per month.
For the “Single request” scenario, $0.00750 per request — ~$0.2250/month at 1 requests/day. Enter your own numbers below to recompute instantly; the full step-by-step math is shown under the worked example.
Results update automatically as you type.
- Input cost
- $0.00250
- Output cost
- $0.00500
- Per request
- $0.00750
- Per day
- $7.50
- Per month
- $225.00
Estimate what any large language model API will cost you. Enter your input and output token counts, pick a model, and see the cost per request, per day, and per month. Use it to budget an app, compare models, or sanity-check a provider's bill before you commit.
Not sure what to enter? Typical token ranges
Common engineering tasks: bug fixes, endpoints, tests, refactors. These are honest planning ranges for how many tokens an AI coding agent burns to build each item — the cost column uses GPT-4o’s current prices.
| Work item | Typical input tokens | Typical output tokens | Typical cost |
|---|---|---|---|
| Small bug fix | 100,000 | 6,000 | $0.3100 |
| Complex bug fix | 400,000 | 20,000 | $1.20 |
| AI code review of a PR | 200,000 | 8,000 | $0.5800 |
| Unit test suite for a module | 380,000 | 35,000 | $1.30 |
| CRUD API endpoint | 300,000 | 20,000 | $0.9500 |
| Third-party API integration | 600,000 | 35,000 | $1.85 |
| Refactor a module | 750,000 | 42,000 | $2.30 |
| Data / schema migration | 520,000 | 30,000 | $1.60 |
| Technical documentation | 220,000 | 25,000 | $0.8000 |
Ranges assume a whole agent session (many turns, context re-sent), not a single prompt. See how many tokens does X take for full low/typical/high ranges, or open the Cost to build X estimator to plug in your own model.
How this is calculated
Cost per request = (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price). Input and output are priced separately, and output is usually 3–5× more expensive per token, so long generations dominate the bill.
We pull the input and output price for your chosen model from our live pricing data (refreshed daily) and multiply by your token counts. Daily and monthly figures scale the per-request cost by requests per day × 30. Prompt caching reduces the price of the cached share of input tokens; batch pricing swaps in the provider's discounted batch rates when enabled.
Is this a good result? What to do next
Judge the per-request number against your revenue per request, not in isolation. A $0.01 call is cheap for a paid feature but expensive if you run it free millions of times a day. The monthly figure is what matters for budgeting — multiply it out to a year and check it against the value the feature creates.
Typical planning ranges
- Budget/mini models (e.g. GPT-4o mini, Gemini Flash)
- ~$0.15–$0.60 per 1M tokens
- Mid-tier models (e.g. GPT-4o, Claude Sonnet)
- ~$3–$15 per 1M tokens
- Frontier/reasoning models
- ~$15–$75 per 1M output tokens
- Typical short request (1k in / 500 out, mid-tier)
- ~$0.005–$0.02
Ranges are typical planning figures to sanity-check your result, not authoritative benchmarks. Your numbers will vary with use case, volume, and vendor.
How to improve this number
- Route simple requests to a cheaper/smaller model and reserve frontier models for hard ones.
- Trim the system prompt and cap max output tokens — output is the expensive side.
- Enable prompt caching for repeated context (system prompts, few-shot examples).
- Use batch pricing for non-real-time jobs to get the discounted rate.
Common mistakes
- Forgetting output tokens are billed at a higher rate than input.
- Estimating with average tokens when a few large requests skew the real bill.
- Ignoring retries, tool-call round-trips and moderation calls that add hidden requests.
When to use a different approach
If you resend a growing conversation history each turn, use the chatbot cost calculator, which models history growth. If you're comparing many models for one workload, use the model cost comparison.
Worked examples
Real scenarios you can reproduce by loading these presets in the calculator above:
Single request
- Input cost
- $0.00250
- Output cost
- $0.00500
- Per request
- $0.00750
- Per day
- $0.00750
- Per month
- $0.2250
- input: 1,000 / 1e6 x $2.5/M = $0.00250
- output: 500 / 1e6 x $10/M = $0.00500
- monthly = $0.00750 x 1 x 30 days
Small app (1k/day)
- Input cost
- $0.00250
- Output cost
- $0.00500
- Per request
- $0.00750
- Per day
- $7.50
- Per month
- $225.00
- input: 1,000 / 1e6 x $2.5/M = $0.00250
- output: 500 / 1e6 x $10/M = $0.00500
- monthly = $0.00750 x 1,000 x 30 days
Scale (100k/day)
- Input cost
- $0.00250
- Output cost
- $0.00500
- Per request
- $0.00750
- Per day
- $750.00
- Per month
- $22,500.00
- input: 1,000 / 1e6 x $2.5/M = $0.00250
- output: 500 / 1e6 x $10/M = $0.00500
- monthly = $0.00750 x 100,000 x 30 days
Sources & references
Frequently asked questions
How is LLM API cost calculated?+
Cost = (input tokens / 1,000,000 x input price) + (output tokens / 1,000,000 x output price). Providers price input and output tokens separately, and output is usually more expensive.
What are input vs output tokens?+
Input tokens are everything you send (system prompt, history, user message). Output tokens are what the model generates. You pay for both, at different rates.
How can I reduce cost?+
Use a smaller or cheaper model, shorten prompts, cap output length, enable prompt caching for repeated context, and use batch pricing for non-real-time jobs.
Related calculators
Answering a real question?
This calculator powers these problem-solving guides:
- How much does an AI coding assistant cost per developer?
- What does an AI email-drafting feature cost per user?
- How much will an AI summarization feature cost per month?
- How much will AI-powered autocomplete cost at scale?
- How much does an AI product-recommendation feature cost?
- How much will an AI resume-screening tool cost per candidate?