Self-hosting vs API cost calculator
The monthly cost of renting GPUs to run a model yourself, beside what 169 API models charge for the same tokens, with the volume where the two are equal.
How it is worked out: GPU cost = price per GPU-hour × GPUs × hours. API cost = tokens × the model’s input and output prices at your input share. Break-even tokens = GPU cost ÷ the API’s blended price per token; tokens per second = that volume ÷ the hours in seconds. GPU prices are the 78 rows on GPU cloud pricing, checked 2026-11-24; API prices come from each model’s page.
Calculator
- GPU rental a month
- $3,350.70
- $4.59 × 1 × 730 h
- Steady rate your volume needs
- 190 tokens/s
- Tokens the GPUs can serve a month
- Enter throughput
169 API models at list price, lowest API cost for your volume first.
| API model | API cost for your tokens | Tokens/month where API = GPU cost | Tokens/s the GPUs must sustain for that |
|---|---|---|---|
| Gemma 4 31B Google | $0.0000 | — | — |
| Gemma 4 26B A4b Google | $0.0000 | — | — |
| Ling 3.0 Flash Ant Group | $12.60 | 132.96B | 50,595 |
| gpt-oss-20b OpenAI | $27.50 | 60.92B | 23,182 |
| Amazon Nova Micro V1 Amazon | $30.63 | 54.71B | 20,816 |
| Granite 4.1 8B IBM | $31.25 | 53.61B | 20,400 |
| Gemma 3 4B IT Google | $31.25 | 53.61B | 20,400 |
| gpt-oss-120b OpenAI | $32.50 | 51.55B | 19,615 |
| Llama 3.2 1B Instruct Meta | $36.25 | 46.22B | 17,586 |
| Gemma 3N E4b IT Google | $37.50 | 44.68B | 17,000 |
| Gemma 3 12B IT Google | $37.50 | 44.68B | 17,000 |
| Phi 4 Microsoft AI | $43.75 | 38.29B | 14,571 |
| OLMo 2 0325 32B Instruct Ai2 | $43.75 | 38.29B | 14,571 |
| NVIDIA Nemotron 3 Nano 30B A3b Bf16 NVIDIA | $52.50 | 31.91B | 12,143 |
| Amazon Nova Lite V1 Amazon | $52.50 | 31.91B | 12,143 |
| Llama 3.2 3B Instruct Meta | $60.00 | 27.92B | 10,625 |
| Hy4 flash Tencent | $61.38 | 27.3B | 10,387 |
| GPT 5 Nano High OpenAI | $68.75 | 24.37B | 9,273 |
| Step 3.5 Flash StepFun | $75.00 | 22.34B | 8,500 |
| Llama 3.3 70B Instruct Meta | $77.50 | 21.62B | 8,226 |
| Gemma 3 27B IT Google | $86.25 | 19.42B | 7,391 |
| MiMo V2.6 Flash Xiaomi | $87.50 | 19.15B | 7,286 |
| Qwen3.5 Flash Alibaba | $87.50 | 19.15B | 7,286 |
| NVIDIA Llama 3.3 Nemotron Super 49B V1.5 NVIDIA | $87.50 | 19.15B | 7,286 |
| GPT-6 Luna OpenAI | $100.00 | 16.75B | 6,375 |
Which GPU a model needs: local LLM hardware requirements. Open-weight models and licenses: open-source LLM leaderboard. Per-conversation API costs: AI chatbot cost calculator.
Frequently asked questions
When is self-hosting an LLM cheaper than an API?+
When the tokens you actually serve in a month cost more through the API than the GPUs cost to rent. A rented GPU is billed by the hour whether it is busy or idle, so the comparison depends on how much of those hours it spends serving requests. The calculator gives the monthly volume where the two costs are equal, and the steady tokens per second the GPUs would need to reach it.
Why does the calculator not assume a throughput?+
Tokens per second on a GPU depend on the model and its size, quantization, the serving software (such as vLLM or TensorRT-LLM), batch size, context length and the split of input and output tokens. The same H100 can differ by an order of magnitude between setups, so the page asks for a figure you have measured instead of using a generic one.
What costs does the GPU figure leave out?+
Storage, network egress, tax, engineering and monitoring time, and idle capacity kept for traffic peaks. Some providers also bill a minimum term or sell GPUs only in 8-GPU machines; the notes on the GPU cloud pricing page say where.
Which models can I self-host?+
Open-weight models, whose weights the developer publishes for download, such as Llama, Qwen, DeepSeek, Mistral and Gemma releases. Closed models such as GPT, Claude and Gemini are available only through their APIs. The open-source leaderboard lists open-weight models with their licenses.