Skip to content

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 modelAPI cost for your tokensTokens/month where API = GPU costTokens/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.60132.96B50,595
gpt-oss-20b OpenAI$27.5060.92B23,182
Amazon Nova Micro V1 Amazon$30.6354.71B20,816
Granite 4.1 8B IBM$31.2553.61B20,400
Gemma 3 4B IT Google$31.2553.61B20,400
gpt-oss-120b OpenAI$32.5051.55B19,615
Llama 3.2 1B Instruct Meta$36.2546.22B17,586
Gemma 3N E4b IT Google$37.5044.68B17,000
Gemma 3 12B IT Google$37.5044.68B17,000
Phi 4 Microsoft AI$43.7538.29B14,571
OLMo 2 0325 32B Instruct Ai2$43.7538.29B14,571
NVIDIA Nemotron 3 Nano 30B A3b Bf16 NVIDIA$52.5031.91B12,143
Amazon Nova Lite V1 Amazon$52.5031.91B12,143
Llama 3.2 3B Instruct Meta$60.0027.92B10,625
Hy4 flash Tencent$61.3827.3B10,387
GPT 5 Nano High OpenAI$68.7524.37B9,273
Step 3.5 Flash StepFun$75.0022.34B8,500
Llama 3.3 70B Instruct Meta$77.5021.62B8,226
Gemma 3 27B IT Google$86.2519.42B7,391
MiMo V2.6 Flash Xiaomi$87.5019.15B7,286
Qwen3.5 Flash Alibaba$87.5019.15B7,286
NVIDIA Llama 3.3 Nemotron Super 49B V1.5 NVIDIA$87.5019.15B7,286
GPT-6 Luna OpenAI$100.0016.75B6,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.