Guides → Playground & Guide → Self-Host vs API - Where the Break-Even Actually Is

Self-Host vs API - Where the Break-Even Actually Is

Meet Wei Chen. VP Engineering at a 200-person Series C startup. "We spend $40K/mo on Anthropic. Should we self-host an open-source model on our own GPUs?"

🔥 CFO loves the math. CTO doesn't trust the math.

The story

Self-hosting math is seductive and frequently wrong. A $40K/mo API bill compared to $5K/mo of GPU rental looks obvious. Then add: 1 ML engineer ($25K loaded), 1 SRE ($20K), inference framework licenses, model serving infra, observability, drift monitoring, eval pipeline, version management, security patches. The 'savings' usually disappear above the line.

Wei's $40K Anthropic bill is just under the threshold where self-host might pencil. Below $30K/mo: API always wins. Above $80K/mo: self-host usually wins (if utilization is good). In the middle: depends on workload predictability, privacy needs, and whether you're already paying for ML headcount for other reasons.

The privacy multiplier matters. If your workload absolutely requires self-hosting (HIPAA + you can't trust a BAA, on-prem-only enterprise customers, training data you can't expose), the math changes. Privacy isn't a cost saving - it's a deal-blocker that justifies negative ROI on infra.

This calc walks through the real numbers - fully-loaded ops cost, GPU utilization assumptions, and where the line actually is for your scale.

🎮 Playground

Self-Host vs API Playground

Here are the inputs that move the result the most. Play with the sliders and check it out. The number updates live.

Self-host vs API — which is cheaper, and when?

API spend is what you pay today. Self-host trades it for fixed GPU + MLOps costs that only pay off at steady scale. GPU utilization fixed at 50%.

API
/ month
Self-host
/ month

💡Cheaper now is pure cost. Best fit weighs the catch: self-host’s GPU + MLOps is fixed, so it only wins with high, steady utilization.

Three real scenarios

Same calculator, three team sizes. Click a tab to see how the numbers shift.

$27,500 / month ≈ $330,000 / year

$10K API spend vs $5K GPU + $15K ops = $20K self-host. API wins by half. At this scale, self-hosting is engineering theater. Stay on API; invest in prompt/cache optimization.

Healthy range: API wins by ~$10K/mo

See inputs used
currentApiSpendMonthlyUsd
10,000
gpuMonthlyRentalUsd
5,000
mlOpsLoadedCostMonthlyUsd
15,000
gpuUtilizationPct
40

Use cases

Same calculator, different applications. Sizes above, workloads here. Pick the one that looks like yours.

Pre-loaded scenarios for the most common applications. Click a tab to see realistic numbers, then hit "Try this scenario" to load it into the calculator above.

$110,000 / month ≈ $1,320,000 / year

Consumer-scale app with predictable load. High utilization (>70%) achievable. Self-host saves >$1M/year. Mandatory at this scale.

Healthy range: Self-host saves $105K/mo (53%)

See inputs used
currentApiSpendMonthlyUsd
200,000
gpuMonthlyRentalUsd
45,000
mlOpsLoadedCostMonthlyUsd
50,000
gpuUtilizationPct
75

Ready to run the numbers?

Open the full calculator. Pick a model, enter your tokens, see per-call, daily, monthly, and annual cost.

🚀 Open the full calculator →

Cheapest API alternatives (compare to self-host)

Verified 11 hours ago
  1. 1
    GPT-5 Mini
    $0.250 in · $2.00 out ·
  2. 2
    gpt-5.1-codex-mini
    $0.250 in · $2.00 out ·
  3. 3
    Command
    $1.00 in · $2.00 out ·

About this calculator: Self-Host vs API - Where the Break-Even Actually Is

Self-hosting Llama 3 / Mistral on GPUs vs API: where break-even hits. Includes ops cost, capacity utilization, and the privacy multiplier.

🎛 Inputs you control

Each input shapes the cost. Click an input on the calculator to set it. The explanations below match the live calculator field by field.

API model (comparison baseline): The vendor API you would otherwise call — sets the per-token cost we benchmark self-hosting against.
How to choose: Pick the model you actually use today. If exploring, pick the cheapest one that meets quality bar — self-hosting only beats cheap models at very high volume.
GPU type: Which GPU SKU powers your self-hosted inference (H100, A100, L40S, etc.).
How to choose: H100 for largest models / highest throughput; A100 for mature workloads; L40S/L4 for cost-optimized inference of mid-size models.
Number of GPUs: GPUs needed to serve peak concurrent traffic at acceptable latency.
How to choose: Start with model memory footprint (FP16 weights ≈ 2× params in bytes), then add headroom for KV cache and batching. 1× H100 fits up to ~70B; multi-GPU sharding needed beyond that.
Requests / day: Total inference requests per 24-hour period that the cluster must handle.
How to choose: Use real 7-day or 30-day averages, not peak. Self-hosting math is sensitive to utilization — overestimating traffic makes API look worse than it is.
Avg input tokens / request: Average prompt size per inference call in tokens.
How to choose: Log a week of real calls and take the median, not the max. RAG/system prompts inflate this — count them.
Avg output tokens / request: Average response size per call in tokens.
How to choose: Output tokens are 4× more expensive than input on most APIs. Self-hosting flips this — output throughput is bottlenecked by decode speed. Measure both.
Cluster utilization %: Fraction of GPU-hours actually serving traffic vs idle.
How to choose: 24/7 enterprise traffic: 40-60% realistic. Bursty workloads: 15-30%. Self-hosting payback requires high utilization — under 30% is a red flag for the build path.
Monthly ops cost ($): All-in monthly overhead — engineer time, monitoring, on-call, hosting, vLLM tuning.
How to choose: Conservative: 0.25-0.5 FTE × loaded engineer cost ($15-25k/month). Most teams under-estimate this by 2-3×. Cloud-managed GPUs add a hosting markup on top.
📋 Typical values & starting points Don’t know a value yet? Start with these broad, sourced ballparks — the calculator’s ▾ Typical menus pre-load the same options.

Context: Mid-2026: self-hosting breaks even only at sustained volume (analyses put the crossover at ~50M-250M tokens/mo vs premium APIs, and often never vs budget APIs). Ops labor is the hidden line: 10-20 hrs/mo minimum ($750-3K), a full MLOps FTE ~$145K/yr. Breakeven typically needs 60%+ GPU utilization.

Input Default Typical ballparks
currentApiSpendMonthlyUsd moves the needle 40,000 Growing product · $5K/mo = 5,000 · Serious volume · $40K/mo = 40,000 · Enterprise portfolio · $150K/mo = 150,000
gpuMonthlyRentalUsd moves the needle 8,000 Single H100/A100 · ~$2.5K/mo = 2,500 · 4x H100 neocloud · ~$8K/mo = 8,000 · 8x H100 node · ~$18K/mo = 18,000
mlOpsLoadedCostMonthlyUsd moves the needle 25,000 Part-time (~25% eng) · $3K/mo = 3,000 · One MLOps FTE · $12K/mo = 12,000 · Small platform team · $25K/mo = 25,000
gpuUtilizationPct 50 Real-world low · 20% = 20 · Typical · 50% = 50 · Well-batched · 70% = 70

Ballparks are broad industry starting points (sourced ranges; * = rough estimate) — your result gets more accurate as you replace them with measured numbers. Try them live in the calculator; API & agent users get the same data from the MCP resource aicost://input-reference/self-host-breakeven.

Reading your result

Self-host total monthly cost = GPU rental + ops + tooling. Compare to API spend. Break-even is when API ≥ self-host total.

Watch utilization carefully. A 1×A100 setup at 30% utilization costs the same as at 90% utilization - but processes 3× less work. Low-utilization self-host loses to API every time. Aim for 60%+ before committing.

Read the headcount line item honestly. 'We'll have an ML engineer manage it part-time' = 0.3 FTE = $8K-12K/mo loaded. Most teams underestimate this 3-5×. Add a real number to your model.

The migration cost is 6-12 months of pain. Beyond inference cost: prompt portability (your Anthropic prompts won't work as-is on Llama), eval pipeline rebuild, latency regressions, edge-case quality drops. Budget the engineering time.

What "good" looks like:
  • API wins clearly: <$30K/mo API spend. Self-host fixed costs dominate.
  • Toss-up: $30K-80K/mo. Depends on utilization, privacy needs, existing ML headcount.
  • Self-host wins (if executed): >$80K/mo with stable workload + dedicated team.
  • Privacy override: regulated industries where API isn't an option, regardless of cost.

What this calculator can't tell you

Honest limitations. Every model is wrong; some are useful. Where this one falls short:

For these, use: Fine-Tuning Cost for self-hosted FT detail. Scale Projection for break-even at growth.

Trade-offs

Cost isn't the only dimension. Click any constraint to see how recommendations change.

What matters most to you? Click any dimension — recommendations update.

Best fit for "cost":

  1. API: pay-per-use Optimal for variable workloads
  2. Self-host: fixed cost Optimal for predictable high-volume

API is variable cost; self-host is fixed cost. The break-even depends on your utilization. For predictable workloads >70% utilization at high scale, fixed cost wins. For bursty/unpredictable, variable cost wins every time.

Most popular

Everything above is the 80% case. The last 20% is where the money is.

The gaps we just listed are real, and they are the expensive ones: your actual prompts, your switching cost, your MLOps overhead. An AICost expert spends the hour on your AI and cloud costs, not a generic playbook. You leave with a written report: the way forward, in 30 days of concrete steps.

  • An hour with the people who built the engines
  • Report the same day
  • The fee credits toward any AICost plan
  • Two slots a week
Book a Solution Session: $299 → or $99 for small business →

Not sure yet? The $39 AICost Blueprint credits toward a Session, and the Session fee credits toward any plan. You never pay twice for the same ground. See all pricing →

Ready to run your own numbers?

You have seen the shape of it. Open the calculator with your model, your tokens, your volume.

🚀 Open the full calculator →

Where to go next

Will you cross break-even with growth? →

Project bill at 10×, see when self-host becomes the right call.

Self-host as lock-in hedge →

How much vendor exposure does self-host eliminate?

Full TCO including migration cost →

7-step wizard with sensitivity analysis.

Methodology

Source
https://aws.amazon.com/ec2/instance-types/p5/
Extraction
GPU pricing from major cloud providers (AWS, GCP, Azure, Lambda Labs) verified quarterly.
Editorial gate
8-layer defense, see aicost.ai/ai-cost-economics
Last verified
7/27/2026, 8:00:00 PM

Author: Subu Vdaygiri, Founder & CEO of CloudIntelligence.ai. 17 years Fortune 100 (Ingram Micro, Siemens). Wharton CTO program · Kellogg CPO program · 10× AWS+Azure certified.

3 years of pricing history

Why this matters: pricing for major vendors has dropped 40-90% in the last 24 months. A budget set 12 months ago is probably wrong by 30%+.

View 3-year history for →
📖 Data sources & methodology 163 text models · 9 embeddings · 37 vision · 55 audio · 8 vector DBs across 10 vendor pages · last verified 2026-07-28

Methodology

  • All prices are USD per 1 million tokens, current as of 2026-07-28.
  • Vendor-published values have no mark. Inferred/extrapolated values are marked with * and listed below.
  • Batch API discounts are 50% off standard rates across providers that offer Batch mode.
  • Prompt caching discounts vary by provider (typically 80-90% off cached input tokens).
  • Regional data-residency surcharges (Anthropic 1.1x, OpenAI 1.1x, Google regional tiers) are NOT included in base rates.
  • Long-context pricing tiers apply when input exceeds model threshold.
  • Embedding prices are input-only (no output tokens generated).

Primary sources

Last-verified date is the most recent successful daily snapshot (aicost_pricing_snapshots) or, when no snapshot exists yet, the latest successful crawler run (aicost_crawler_runs). 10 of 10 vendors are currently verified. Aggregator services (TokenCost, AI Pricing Guru, etc.) are not listed.

Anthropic
2026-07-28
https://www.anthropic.com/pricing
Daily snapshot since Sep 2023 · 631 days captured
Anthropic Docs
2026-07-28
https://platform.claude.com/docs/en/about-claude/pricing
Daily snapshot since Sep 2023 · 631 days captured
OpenAI
2026-07-28
https://openai.com/api/pricing/
Daily snapshot since Sep 2023 · 632 days captured
Google AI
2026-07-28
https://ai.google.dev/gemini-api/docs/pricing
Daily snapshot since Dec 2023 · 607 days captured
Google Vertex
2026-07-28
https://cloud.google.com/vertex-ai/generative-ai/pricing
Daily snapshot since Dec 2023 · 607 days captured
DeepSeek
2026-07-28
https://api-docs.deepseek.com/quick_start/pricing
Daily snapshot since May 2024 · 546 days captured
xAI
2026-07-28
https://x.ai/api
Daily snapshot since Nov 2024 · 464 days captured
Mistral
2026-07-28
https://mistral.ai/pricing
Daily snapshot since Dec 2023 · 605 days captured
Cohere
2026-07-28
https://cohere.com/pricing
Daily snapshot since Sep 2023 · 631 days captured

Inferred values (marked with * in calculator tables)

Derived from industry conventions, not directly published by the vendor. Typical conventions: cached input = 10% of base (90% off), Batch API = 50% of base (50% off).

Vendor / Model Field Why it’s inferred
Anthropic — Claude Sonnet 4.6 cachedInput Derived at 10% of input rate — Anthropic publishes 90% cache-hit discount on this tier.
Anthropic — Claude Sonnet 4.5 cachedInput Derived at 10% of input rate; same 90% cache-hit convention as Sonnet 4.6.
Anthropic — Claude Sonnet 4.5 batchInput Derived at 50% of standard input — Anthropic documents uniform 50% Batch discount.
Anthropic — Claude Sonnet 4.5 batchOutput Derived at 50% of standard output — Anthropic documents uniform 50% Batch discount.
Anthropic — Claude Haiku 4.5 cachedInput Derived at 10% of input rate — Anthropic 90% cache-hit discount convention.
OpenAI — GPT-5.4 Mini cachedInput Derived at 10% of input — OpenAI documents automatic 90% discount on cache hits across GPT-5.x tier.
OpenAI — GPT-5.4 Nano cachedInput Derived at 10% of input — OpenAI 90% cache-hit convention.
OpenAI — GPT-5.4 Nano batchInput Derived at 50% of input — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.4 Nano batchOutput Derived at 50% of output — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.4 Pro cachedInput Derived at 10% of input — OpenAI 90% cache-hit convention.
OpenAI — GPT-5.4 Pro batchInput Derived at 50% of input — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.4 Pro batchOutput Derived at 50% of output — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.2 cachedInput Derived at 10% of input; no residency uplift.
OpenAI — GPT-5.2 batchInput Derived at 50% of input.
OpenAI — GPT-5.2 batchOutput Derived at 50% of output.
OpenAI — GPT-5 cachedInput Derived at 10% of input.
OpenAI — GPT-5 batchInput Derived at 50% of input.
OpenAI — GPT-5 batchOutput Derived at 50% of output.
OpenAI — GPT-5.5 Pro cachedInput Derived at 10% of input — OpenAI does not publish a cached rate for *-pro models; using the family convention.
OpenAI — GPT-5.5 Pro batchInput Derived at 50% of input.
OpenAI — GPT-5.5 Pro batchOutput Derived at 50% of output.
OpenAI — GPT-5.2 Pro cachedInput Derived at 10% of input — pro-tier convention.
OpenAI — GPT-5.2 Pro batchInput Derived at 50% of input.
OpenAI — GPT-5.2 Pro batchOutput Derived at 50% of output.
OpenAI — GPT-5.1 batchInput Derived at 50% of input.
OpenAI — GPT-5.1 batchOutput Derived at 50% of output.
OpenAI — GPT-5 Pro batchInput Derived at 50% of input.
OpenAI — GPT-5 Pro batchOutput Derived at 50% of output.
OpenAI — GPT-5 Nano cachedInput Derived at 10% of input.
OpenAI — GPT-5 Nano batchInput Derived at 50% of input.
OpenAI — GPT-5 Nano batchOutput Derived at 50% of output.
Google — Gemini 3 Flash cachedInput Derived at 10% of input — Google caching discount convention ~90%.
Google — Gemini 3.1 Flash-Lite cachedInput Derived at 10% of input — Google caching convention.
Google — Gemini 3.1 Flash-Lite batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 3.1 Flash-Lite batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
Google — Gemini 2.5 Pro cachedInput Derived at 10% of input.
Google — Gemini 2.5 Flash cachedInput Derived at 10% of input.
Google — Gemini 2.5 Flash-Lite cachedInput Derived at 10% of input — Google caching convention.
Google — Gemini 2.5 Flash-Lite batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 2.5 Flash-Lite batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash cachedInput Derived at 25% of input per Google 2.0 family caching rates.
Google — Gemini 2.0 Flash batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash-Lite cachedInput Derived at 10% of input — Google caching convention.
Google — Gemini 2.0 Flash-Lite batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash-Lite batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
xAI — Grok 4 (legacy) cachedInput Extrapolated at 25% of base.

Pricing is cross-verified against the LiteLLM community registry when available. Daily snapshots are kept in aicost_pricing_snapshots; every change is logged to aicost_price_changelog with old & new values for full audit trail. Read the full methodology →