LLM API vs self-host calculator
Should you keep paying per-token API bills or spin up dedicated H100/H200/B200 GPUs? Enter your monthly token volume, prompt cache hit rate, API pricing, and self-hosted GPU cluster (including redundancy and MLOps overhead) to find your exact break-even volume.
Interactive calculator
| Monthly Total Tokens | Hosted API / mo | Self-Host / mo | Winner | Monthly Delta |
|---|
Frequently asked questions
At what monthly token volume does self-hosting an LLM beat hosted APIs?
Against frontier APIs like Claude Sonnet 4 or GPT-4o ($3–$15/1M output), a 2× H100 cluster (~$4,000–$5,500/mo including ops) breaks even around 300M–600M blended tokens per month. Against cheap serverless open-weight APIs ($0.20–$0.80/1M), self-hosting usually requires 3B+ tokens/month or strict data-residency requirements.
Why do teams underestimate the true cost of self-hosting GPUs?
Self-hosted GPUs bill 730 hours/month whether traffic is peaking or idle at 3 AM. You also need at least 2 replicas for zero-downtime deploys and failover, plus engineering time for vLLM/SGLang upgrades, autoscaling, and monitoring.
How does prompt caching shift the API vs self-host break-even?
Anthropic and OpenAI discount cached input tokens by 50%–90%. For agentic or RAG workloads with 70%–90% cache hit rates, hosted API bills drop sharply, pushing the self-hosting break-even volume 2x–4x higher.
When should you self-host even if an API is cheaper?
Self-hosting wins regardless of token volume when you need HIPAA/SOC2/air-gapped data residency, custom LoRA fine-tuned weights, guaranteed zero rate-limit throttling, or deterministic model weights that never silently change.
How much do reserved GPU instances lower self-hosting cost?
1-year reserved or bare-metal H100/H200 contracts typically save 25%–45% off on-demand cloud rates, pulling the monthly break-even volume down proportionally.
All calculations run locally in your browser. Self-hosted monthly costs assume 730 hours/month continuous availability; verify cluster peak throughput against your traffic burst ratio using the batch size calculator.