AI agents · OpenClaw · self-hosting · automation

Quick Answer

Self-Host vs API LLM: How to Find Your Breakeven Point

Published:

The Short Answer

The break-even calculation has one honest form:

monthly_gpu_cost = hourly_rate × 730
breakeven_tokens  = monthly_gpu_cost ÷ blended_api_price_per_token
tokens_per_hour   = breakeven_tokens ÷ 730 ÷ utilisation_rate

For a 320B-class model like GLM-5.3-Flash at $0.15 in / $0.50 out per MTok, running on an MI300X at roughly $2.90/hour (~192GB needed at 4-bit), the crossover sits near 14 million tokens per hour of sustained load.

Most teams evaluating this are running one to two orders of magnitude below that. For them the API is not marginally cheaper — it is dramatically cheaper, and the engineering time saved is worth more than the difference.

Self-host for compliance, control, or genuine scale. Rarely for savings.

Step 1 — Get Your Real Token Volume

Not your projected volume. Your logged volume from the last 30 days, split by input and output, because they price differently — often 3-5x apart.

monthly_input_tokens  = ?
monthly_output_tokens = ?
blended_cost = (in_tokens × in_price) + (out_tokens × out_price)

If you cannot produce these numbers from logs, stop here. You cannot evaluate self-hosting without measurement, and the instinct that drives teams toward self-hosting is usually a surprise invoice rather than an analysed one.

Completion criterion: you can state monthly input tokens, monthly output tokens, and last month’s actual API spend to the dollar.

Step 2 — Price the Hardware Your Model Actually Needs

Size on total parameters, never active parameters. A sparse MoE with 18B active still requires all 320B in memory.

memory ≈ total_params × bytes_per_param × 1.3

(2 bytes at BF16, ~0.5 at 4-bit; the 1.3 covers KV cache, activations and framework overhead — go higher for long context.)

Indicative rental costs as of August 2026:

Model class4-bit memoryHardware~$/hour~$/month
30B dense~20GB1× consumer 24GBownedelectricity
125B MoE~70-80GB1× H100 80GB~$2.00~$1,460
320B MoE~192GB1× MI300X~$2.90~$2,088
700B+400GB+multi-GPU node$8-12$5,800-8,800

Rates vary widely by provider and commitment term. Get real quotes; treat these as order-of-magnitude.

Completion criterion: you have a written hourly quote for hardware that provably fits your chosen model.

Step 3 — Divide, Then Divide Again for Utilisation

The arithmetic is trivial. The correction afterwards is what people skip.

Worked example, GLM-5.3-Flash class, 70/30 input/output mix:

  • Blended API price ≈ $0.255 per MTok
  • GPU cost: $2.90 × 730 = $2,117/month
  • Break-even volume: $2,117 ÷ $0.255 ≈ 8.3 billion tokens/month
  • Per hour at 100% utilisation: ≈ 11.4M tokens/hour

Now the correction. You will not run at 100% utilisation. Real production traffic is bursty: weekday-weighted, business-hours-weighted, with overnight troughs. Typical sustained utilisation for an internal workload is 20-40%.

At 30% utilisation, your traffic must peak near 38M tokens/hour for the box to pay for itself — because you pay for all 730 hours whether or not you use them.

This is the number that kills most self-hosting business cases. The API charges you for tokens. The GPU charges you for time.

Completion criterion: you have a tokens-per-hour threshold adjusted for measured utilisation, compared against your actual peak throughput.

Step 4 — Add the Costs That Never Make the Spreadsheet

CostTypical impact
Serving engineering0.25-1.0 FTE ongoing
Idle capacity60-80% of GPU-hours produce nothing
Peak over-provisioningSize for peak, pay at peak, run at mean
Model updatesRe-evaluate, re-quantise, re-deploy every release
Incident responseYou are now on-call for inference
Storage + egressWeights are hundreds of GB
Opportunity costThose engineers are not shipping product

One engineer at a loaded cost of $150,000/year is $12,500/month — roughly six MI300X-months. Even a quarter-FTE adds more than $3,000/month to a $2,117 hardware line, more than doubling the true cost.

Completion criterion: your monthly self-host figure includes a named, costed engineering allocation.

Step 5 — Check the Non-Cost Reasons First

Several reasons to self-host are legitimate regardless of the arithmetic:

  • Data residency / regulatory — the data legally cannot leave your infrastructure.
  • Air-gapped — no external network, full stop.
  • Version pinning — vendors deprecate models. Weights you hold cannot be retired out from under you.
  • Lock-in elimination — a permissive licence (GLM-5.3-Flash is MIT, Muse Glimmer 30B is Apache 2.0) is a credible exit that changes vendor negotiations.
  • Cost predictability — a fixed monthly number your CFO can plan against, versus a variable one that spikes with a traffic surge.

If one of these applies, stop calculating and self-host. Just book it honestly as compliance or risk spend, not as a saving. Teams that mislabel a compliance decision as a cost optimisation get audited on savings they never promised to deliver.

Completion criterion: you have explicitly answered yes or no to each of the five, in writing.

The Middle Path Most Teams Should Take

The framing “self-host or API” is usually a false binary. The setup that actually wins:

  1. Small dense model locally for high-repetition, privacy-sensitive, latency-critical work. Muse Glimmer 30B on a single 24GB GPU costs electricity, not $2,088/month.
  2. Cheap API for volume. GLM-5.3-Flash at ~$0.007 per 30K-in/5K-out task, or DeepSeek V4 Flash off-peak at ~$0.0099.
  3. Frontier API for the hard 5-10%. Claude Opus 5 or GPT-5.6 Sol, where quality genuinely decides the outcome.

That blend beats a uniform frontier bill by an order of magnitude and beats a self-hosted cluster on total cost of ownership until you are very, very large.

Prove you are at scale with logs before you buy GPUs. The break-even is real, but it lives much further out than the pitch decks suggest.

Sources