The Economics of Self-Hosted LLMs vs API — When Does Local Make Sense?
TL;DR
Self-hosting LLMs saves money only past a critical usage threshold — typically around 500K to 2M API tokens per day, depending on which API and model you compare against. Below that, cloud APIs win on every dimension except privacy. Between 2M and 10M tokens/day, consumer GPUs (RTX 4090) become competitive. Past 10M tokens/day, enterprise GPUs (A100, H100) and multi-GPU rigs deliver the lowest cost per token.
However, "cost per token" is only one variable. Privacy, latency, uptime guarantees, and developer velocity often justify API spending even when self-hosting is technically cheaper — or vice versa.
The Real Question Is Not "Which Is Cheaper"
It is "which is cheaper for your workload."
Three factors determine the answer:
- Token volume — how many tokens do you process daily?
- Model tier — which quality class do you need?
- Operational complexity tolerance — do you have someone to maintain the infrastructure?
This article walks through the math so you can plug your own numbers.
API Pricing Landscape (April 2026)
Here is the current pricing for popular models, per 1 million tokens:
| Provider | Model | Input / 1M | Output / 1M | |---|---|---|---| | OpenAI | GPT-4o-mini | $0.15 | $0.60 | | OpenAI | GPT-4o | $2.50 | $10.00 | | Anthropic | Claude Sonnet 4 | $3.00 | $15.00 | | Anthropic | Claude Opus 4 | $15.00 | $75.00 | | Google | Gemini 2.0 Flash | $0.075 | $0.30 | | Google | Gemini 2.0 Pro | $1.25 | $5.00 | | Google | Gemini Ultra | $3.50 | $10.50 |
Typical cost baseline: For an application processing 100K tokens/day (roughly 3M/month) on GPT-4o-mini, you pay about $480/month. On Claude Sonnet, about $5,700/month.
These numbers are important because they establish the target your GPU rig must beat, after including hardware depreciation and electricity.
The Hardware Equation
Consumer GPUs
| GPU | VRAM | Price | Power | Approximate Throughput | |---|---|---|---|---| | RTX 4060 Ti (16GB) | 16GB | ~$450 | 160W | 13B @ Q4: ~15 tok/s | | RTX 4070 Ti Super | 16GB | ~$800 | 285W | 13B @ Q4: ~25 tok/s | | RTX 4090 | 24GB | ~$1,600 | 450W | 13B @ Q4: ~35 tok/s; 30B @ Q4: ~15 tok/s | | RTX 5090 (new) | 32GB | ~$2,000 | 575W | 30B @ Q4: ~20 tok/s; 70B @ Q4: ~7 tok/s |
A single RTX 4090 can comfortably run 13B models at Q4/Q5 quantization, and 30B models at Q4 with some performance cost. The RTX 5090 pushes this further with 32GB VRAM, enabling 30B models with better quantization (Q8) and even 70B at Q4.
Enterprise GPUs
| GPU | VRAM | Price | Power | Approximate Throughput | |---|---|---|---|---| | A10G | 24GB | ~$1,400 | 300W | Comparable to RTX 3090 | | A6000 | 48GB | ~$4,600 | 300W | 30B @ Q8: ~20 tok/s | | A100 (80GB) | 80GB | ~$12,000 | 400W | 70B @ Q8: ~30 tok/s; 8B/7B: 100+ tok/s | | H100 (80GB) | 80GB | ~$30,000 | 700W | 70B @ FP16: ~50 tok/s; 8B/7B: 200+ tok/s |
Enterprise GPUs offer higher memory bandwidth and multi-GPU NVLink connectivity, which matters more for large models (70B+) than for 8B or 13B models.
The Electricity Bill
This is the hidden cost most analyses ignore.
An RTX 4090 under load draws ~450W. Running 24/7 at 50% average utilization:
- 0.45 kW * 20h/day * $0.12/kWh = $1.08/day = ~$32/month
Four RTX 4090s in a single system:
- ~$128/month in electricity alone.
An A100 server (4x A100):
- Power is roughly 1,600W under load, or ~$350/month at full utilization.
Compare this to API pricing: $32-128/month in electricity is trivial — if you are actually generating enough tokens to offset the hardware purchase.
Break-Even Math
Example 1: GPT-4o-mini vs RTX 4090 (13B model, Q4)
Monthly API cost for 3M tokens/day ($90M/month, 60/40 input/output split):
- Input: 54M at $0.15/M = $8.10
- Output: 36M at $0.60/M = $21.60
- Total: ~$30/day = ~$900/month
Monthly self-host cost on RTX 4090:
- GPU depreciation (3-year life): $1,600 / 36 = ~$44/month
- Electricity (~$32/month): ~$32/month
- System amortization (CPU, RAM, PSU, case): $2,000 / 36 = ~$56/month
- Maintenance and sysadmin time (estimated 2h/month @ $50/h): ~$100/month
- Total: ~$232/month
Break-even: At current API rates, even at 3M tokens/day, the 4090 rig costs about $227/month, which is about 4x cheaper than GPT-4o-mini APIs.
Example 2: Claude Sonnet vs RTX 4090 (30B model, Q4)
Monthly API cost for 1M tokens/day:
- Input: 600K at $3.00/M = $1.80
- Output: 400K at $15.00/M = $6.00
- Total: ~$7.80/day = ~$234/month
Monthly self-host cost on RTX 4090 (same as above):
- ~$232/month
Break-even: Roughly 1M tokens/day on Claude Sonnet. Past that, self-hosting a comparable-quality 30B model (like Qwen2.5-32B or Mistral Large) saves money.
Example 3: Multi-GPU A100 vs heavy API usage
At 100M tokens/day (3B/month), API costs explode:
- GPT-4o-mini: ~$27,000/month
- Claude Sonnet: ~$270,000/month
A 4x A100 rig at $60,000 hardware cost:
- Depreciation: $1,667/month (3yr)
- Electricity: $350/month
- Total: ~$2,000/month
At this scale, self-hosting saves 10-100x on API costs.
The Hidden Costs Nobody Talks About
1. Quantization Quality Loss
Running 70B at Q4 is not equivalent to running GPT-4o. Quantization trades off precision. A Q4 70B model may lose 5-15% quality depending on the metric. If your application needs GPT-4o-level reasoning, no single consumer GPU can match it today.
2. Context Window Limitations
APIs offer 128K+ context windows out of the box. Self-hosting at those context lengths requires serious VRAM allocation. A 128K context on a 70B model needs ~140GB just for the KV cache. Most consumer setups cap at 8K-32K context.
3. Downtime and Maintenance
An API is always up. Your server is not. Updates, driver issues, CUDA version conflicts, OOM crashes — these are your problems now. Budget 2-5 hours of sysadmin time per month minimum.
4. Model Updates
APIs get upgraded transparently. When you self-host, you must manually pull new model versions, test compatibility, and manage rollbacks. If a new model version breaks your pipeline, you fix it yourself.
5. Concurrent Requests
A single RTX 4090 serves one request at a time (or a small batch). An API handles thousands of concurrent users. Multi-GPU setups or inference servers like vLLM help, but you are now running a load-balanced fleet, not a single box.
When Self-Hosting Makes Sense
1. Privacy-First Workloads
If you process sensitive data — medical records, financial documents, internal company data — and cannot legally or ethically send it to external APIs, self-hosting is mandatory. The cost comparison is irrelevant; it is a compliance requirement.
2. Predictable High Volume
If your daily token volume is consistently above 1M tokens and stable, the economics shift dramatically. The more tokens you process, the harder APIs get to justify on pure cost.
3. Custom Model Fine-Tuning
If you need to fine-tune models on proprietary data, you must have the hardware to both train and run them. APIs do not run your weights.
4. Latency-Sensitive Applications
Round-trip API latency is typically 200-800ms for smaller models. Self-hosting on local hardware can reduce this to 50-200ms because you eliminate network overhead. For real-time applications (chatbots, voice agents), this matters.
5. Experimentation and Development
If your team is constantly testing new models, tweaking prompts, and benchmarking architectures, the cost of API calls during R&D adds up. A local rig is cheaper for exploratory work — even low-end hardware helps.
When APIs Win
1. Sporadic or Unpredictable Usage
If you are building an MVP, running occasional batch jobs, or have highly variable traffic, pay-per-use APIs are dramatically cheaper than idle hardware.
2. Need Frontier Performance
No open model matches GPT-4o or Claude Opus on complex reasoning, multi-step tasks, or creative generation. If your application requires that tier, APIs are the only option. Open models have gaps but the frontier gap has narrowed significantly.
3. Small Teams with No Sysadmin
If you are a team of 2-3 developers who need reliable inference, the 2-5 hours/month of GPU server maintenance is a meaningful percentage of your capacity. APIs remove that entire surface area.
4. Rapid Scaling Required
If your user base might 10x overnight, an API scales automatically. Your server does not. You will either over-provision (wasting money) or under-provision (angering users).
Practical Recommendations
For Individuals and Hobbyists (< 100K tokens/day)
Use APIs. The math does not work out for local hardware at this volume. A $450 RTX 4060 Ti takes over a year just to pay for itself on GPT-4o-mini APIs. Use OpenRouter or Groq to access multiple models without committing to one provider.
For Small Teams (100K - 1M tokens/day)
Hybrid approach. Use APIs for production and a modest local GPU (RTX 4060 Ti or 4070 Ti Super) for development, prototyping, and privacy-sensitive tasks. This gives you the best of both worlds.
For Growing Companies (1M - 10M tokens/day)
Consider a dedicated GPU server. An RTX 4090 rig starts paying for itself against GPT-4o pricing at about 500K tokens/day. At 2M+ tokens/day, it is clearly cheaper. You can use it for the bulk of your traffic while keeping APIs as a fallback for edge cases requiring frontier models.
For Large Operations (10M+ tokens/day)
Go self-hosted with enterprise hardware or cloud GPUs. At this scale, API costs become unsustainable. A 4x A100 setup, or renting GPU instances from providers like Lambda Labs, Together, or Modal, delivers the lowest cost per token with the flexibility to scale up or down.
The Framework: How to Decide
Use this decision tree for your specific case:
- Do you need to keep data local? If yes, self-host. Stop analyzing further.
- What is your daily token volume?
- < 500K tokens: use APIs
- 500K - 2M: consider hybrid
- 2M+: evaluate self-hosting economics
- Do you need frontier-quality reasoning? If yes, APIs (for now).
- Do you have someone to maintain a GPU server? If no, APIs.
- Will your usage be stable? If no (spiky/bursty), APIs are more cost-effective.
Conclusion
The economics of self-hosting vs APIs are not ideological — they are arithmetic. Self-hosting is not automatically cheaper, and APIs are not always a ripoff. The right answer depends entirely on your token volume, quality requirements, and operational capacity.
For most individuals and small teams starting out, APIs win. As your usage scales past predictable thresholds — typically around 1-2M tokens/day against mid-tier API models — a dedicated GPU rig becomes the economically rational choice. Past 10M tokens/day, enterprise GPU infrastructure is the only financially sustainable option.
The real value of self-hosting, though, is not just cost savings. It is independence. When you are not at the mercy of a provider's rate limits, model changes, pricing updates, or data retention policies, you gain something no spreadsheet can measure: control.
This article was researched and written by Pengu Press AI.