Self-Host vs API Cost Calculator (LLM Break-Even)
Compare the monthly cost of an LLM API with running the model yourself on a rented or owned GPU, and see the token volume where self-hosting breaks even. Free, and it runs in your browser.
Updated November 19, 2026. Not financial advice. This calculator is for education and rough estimates only. It relies on simplified models and your inputs, ignores taxes and many real-world costs, and past or modelled results do not guarantee future outcomes. Consult a licensed professional before making financial decisions.
API
Input plus output tokens per month.
The rest is output.
Example value. Check your provider's current price.
Self-hosted setup
All GPUs together, billed 730 hours a month. Default is an example H100 rate; see the GPU rental calculator for sources.
Hosting, bandwidth, ops. 0 to ignore.
Aggregate across concurrent requests, input and output together.
Average share of peak throughput you actually use.
Result
Blue: API. Red: self-host (steps up when volume needs another setup). Dashed: your volume. Horizontal axis 0 to 3.15B tokens a month, vertical axis 0 to $20,814.
| Tokens / month | API | Self-host | Cheaper |
|---|---|---|---|
| 125.0M | $825.00 | $1,963.70 | API |
| 250.0M | $1,650.00 | $1,963.70 | API |
| 500.0M | $3,300.00 | $1,963.70 | Self-host |
| 1.00B | $6,600.00 | $1,963.70 | Self-host |
| 2.00B | $13,200.00 | $1,963.70 | Self-host |
Assumptions used
- Blended API price = 70% × $3.00 + 30% × $15.00 = $6.600 per 1M tokens. No caching, batch or volume discounts.
- Rented: $2.69/hour × 730 hours = $1,963.70/month, always on.
- Other monthly cost $0.00. One setup costs $1,963.70/month whether busy or idle.
- Capacity of one setup = 2,000 tokens/s × 50% utilization × 2,628,000 s = 2.63B tokens/month. Above that, another setup is added.
- Same model quality on both sides, constant prices, steady load, no engineer time, no idle-GPU scaling to zero.
How to use the self-host vs API calculator
- Enter your monthly token volume, the input share, and the API prices per 1M tokens (see the LLM API cost calculator for provider rates).
- Choose a rented GPU (hourly) or owned hardware (price, amortization, power, electricity).
- Enter throughput and utilization. Estimate speed with the tokens per second calculator and check the model fits with the LLM VRAM calculator.
- Read the monthly costs, the break-even volume and the table. Rental rates: GPU rental cost calculator.
Worked example
500M tokens a month, 70% input, at $3 input and $15 output per 1M tokens: blended price = 0.7 × 3 + 0.3 × 15 = $6.60 per 1M, so the API costs 500 × 6.60 = $3,300 a month. A rented H100 at $2.69 an hour costs 2.69 × 730 = $1,963.70 a month. At 2,000 tokens/s and 50% utilization one GPU serves 2.63B tokens a month, so one setup is enough. Break-even is 1,963.70 ÷ 6.60 ≈ 297.5M tokens a month: below that the API wins, above it self-hosting does. The prices and throughput here are examples, not quotes.
See also
- Estimate your monthly volume with the AI token counter.
- Check hardware needs with the LLM VRAM and RAM calculator.
Frequently Asked Questions (FAQ)
When your steady monthly token volume is high enough to keep the GPU busy. A GPU costs the same whether it is idle or full, while an API charges only per token. The break-even volume in this calculator is the point where the always-on GPU cost equals what the API would charge for the same tokens. Below it, the API is cheaper; above it (up to the GPU's capacity), self-hosting is.
Break-even tokens = monthly self-host cost ÷ blended API price per token. The blended price weights your input and output prices by your input/output mix. If one GPU running at your utilization would still cost more per token than the API, there is no break-even and the calculator says so.
Utilization is the share of the GPU's peak throughput you can actually use on average over the month. Traffic is bursty and you need headroom for peaks, so 30–60% is common for production serving. Batch jobs that can run any time can reach 80% or more. Lower utilization raises your cost per token.
Use aggregate throughput (all concurrent requests together) measured on your model and inference engine, such as vLLM. A single-stream speed is much lower than batched throughput. The LLM tokens per second calculator on this site gives a rough single-stream estimate from memory bandwidth, which is a conservative starting point.
Engineer time, monitoring, redundancy, model quality differences, cached-input and batch discounts, volume discounts, prompt caching, price changes and taxes. API prices change often and self-hosted open models are not equal to frontier models, so treat the result as a rough first check rather than a quote.
Yes. Weights plus KV cache must fit in VRAM across the GPUs you count in your setup. Use the LLM VRAM calculator to check this before trusting any cost comparison, and enter the hourly price or hardware cost for all GPUs in the setup.
Related Tools
- GPU Rental Cost CalculatorEstimate cloud GPU cost per job and per month from hourly rate, GPU count, job and idle hours, storage and egress. Example rates are dated and editable.
- LLM API Cost CalculatorCompare GPT, Claude and Gemini API rates and estimate monthly token costs.
- RAG Chunking and Embedding Cost CalculatorEstimate RAG chunk count, one-off embedding (indexing) cost and monthly query cost from document size, chunk size, overlap, embedding price and retrieval settings. Prices are dated and editable.
- AI Token CounterCount tokens, words and characters in your prompts for GPT, Claude, Gemini and Llama.
- Tokens to Words, Pages and Books ConverterHow many tokens in a word, page or 1,000 words? Convert words, pages and books to tokens and back for six languages.
- LLM VRAM CalculatorEstimate how much GPU memory (VRAM) you need to run a local LLM, and which GPUs can run it.