AI, LLM & Machine Learning Engineering LLM Inference Cost & Serving Fixed-versus-variable cost break-even analysis

Self-Hosted LLM vs API Break-Even Calculator

Self-hosting an open-weights model swaps a variable per-token bill for a fixed hourly one, so it wins above a volume and loses below it. This calculator finds that volume. Enter your GPU hourly rate, how many GPUs the deployment needs, the sustained tokens per second it delivers, the utilisation you can realistically hold, and the API price you are comparing against. You get the break-even monthly token volume, the effective self-hosted cost per million tokens, the capacity your hardware can actually serve, and which option is cheaper at the volume you have today.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
GPU hourly rateRented price per GPU-hour, or your amortised cost per GPU-hour if you own the hardware.2.5 $/h
Number of GPUsGPUs held continuously, including any replica you keep for redundancy.2
Sustained throughputTotal output tokens per second the whole deployment delivers under batching, measured at your real prompt length.2500 tok/s
Realistic utilisationShare of the month the deployment is actually generating at that throughput, after idle nights and traffic peaks.35 %
Monthly platform and operations costAnything the GPU rate excludes: storage, load balancing, monitoring, on-call engineering. Left at zero, the comparison flatters self-hosting.0 $
API blended price per 1M tokensThe managed-API rate you would otherwise pay, blended across input and output in your real mix.3 $
Monthly token volumeTokens you serve in a month across the whole product, counting input and output together.500 M tok

It returns

  • Break-even monthly tokens — Above this monthly volume the fixed GPU bill is cheaper than the per-token bill.
  • Self-hosted monthly cost
  • API cost at your volume
  • Saving from self-hosting — API cost minus self-hosted cost. Negative means the API is cheaper at this volume.
  • Monthly capacity at this utilisation
  • Effective self-hosted cost per 1M tokens

The formula

N*=hg730+OR/1000000
C=T3600730u
c1M=hg730+OC/1000000

In plain text: Break-even tokens = (hourly rate × GPUs × 730 + overhead) ÷ (API rate ÷ 1,000,000)

  • N*Break-even monthly token volume (tokens)
  • hGPU hourly rate ($ / GPU-hour)
  • gNumber of GPUs held continuously (GPUs)
  • OMonthly platform and operations cost ($)
  • RManaged API blended price per million tokens ($ / 1M tok)

730 hours is the average month (8,760 hours ÷ 12). The comparison assumes the GPUs are held for the whole month, which is what a persistent serving deployment does.

Updated Category LLM Inference Cost & Serving Verified against published test cases Reading time 12 min

Why this is a break-even question and not a price comparison

A managed API charges you per token. A GPU charges you per hour whether or not a token is moving. Those are different shapes of cost, so there is no single answer to "which is cheaper" — there is only a volume above which the fixed bill wins and below which it loses. This calculator finds that volume and then tells you where you sit relative to it.

The comparison people usually make is a price comparison: they divide a GPU's hourly rate by its peak throughput, get a cost per million tokens that looks spectacular next to an API rate, and conclude that self-hosting is several times cheaper. The arithmetic is right and the conclusion is usually wrong, because peak throughput is a benchmark number and your deployment does not run at peak. It runs at whatever fraction of the month your traffic actually keeps it busy.

That fraction — utilisation — is the term that decides the answer, and it is the one most often left out. Divide by 35% instead of 100% and your effective cost per million tokens triples. A deployment that looked five times cheaper than the API is now marginally cheaper, and after storage, load balancing, monitoring and the engineer who gets paged at three in the morning, it may not be cheaper at all.

So this calculator asks for utilisation explicitly and refuses to let you skip it. It also asks for platform and operations cost, because a GPU hourly rate is not a total cost of ownership, and comparing a raw GPU rate against a fully-managed API rate compares two different products.

The three formulas behind the answer

Monthly self-hosted cost. The hourly rate times the number of GPUs times 730 hours, plus whatever else you pay to run the platform. 730 is the average month: 8,760 hours in a year divided by 12. Use it rather than 720, which assumes every month is 30 days.

Self-hosted = h × g × 730 + O

Monthly capacity. Sustained throughput in tokens per second, times 3,600 seconds an hour, times 730 hours, times utilisation. Throughput here means what the deployment delivers under your real batching and your real prompt lengths, not the number in a vendor benchmark run at batch 256 with a 128-token prompt. If you do not have a measured figure, estimate one with the throughput and latency calculator and then discount it.

Capacity = T × 3,600 × 730 × u

Break-even volume. Set the two bills equal. The API bill at volume N is N × R ÷ 1,000,000. Solve for the N that makes it match the fixed bill:

N* = (h × g × 730 + O) ÷ (R ÷ 1,000,000)

Two properties of that expression matter. It does not contain throughput or utilisation at all — break-even in tokens depends only on the fixed bill and the API price. Throughput and utilisation enter one step later, as the constraint that decides whether your hardware can actually serve N* tokens. That is the check most spreadsheets miss: a break-even volume your deployment physically cannot reach is not a break-even at all, and the calculator warns when you are in that regime.

The other property is that break-even scales linearly with the fixed bill. Add a second replica for redundancy and you double the volume you need to justify it. Redundancy is a real requirement, but it is bought out of the same budget as the comparison.

Worked example: two GPUs at $2.50 an hour against a $3.00 API

You are serving an open-weights model on two rented GPUs at $2.50 per GPU-hour. Measured on your own traffic the pair sustains 2,500 output tokens per second. Your traffic is business-hours heavy, so you hold about 35% utilisation across the month. The managed API you would otherwise use blends to $3.00 per million tokens, and you currently serve 500 million tokens a month.

  1. Fixed monthly bill. $2.50 × 2 GPUs × 730 hours = $3,650.
  2. Monthly capacity. 2,500 × 3,600 = 9,000,000 tokens per hour. × 730 hours = 6,570,000,000 at full occupancy. × 0.35 = 2,299,500,000 tokens a month.
  3. Effective cost per million. $3,650 ÷ 2,299.5 million = $1.5873 per million tokens. Against $3.00 on the API, that is a little under half the unit price — but only if you fill the capacity.
  4. API cost per token. $3.00 ÷ 1,000,000 = $0.000003.
  5. Break-even volume. $3,650 ÷ $0.000003 = 1,216,666,667 tokens a month, about 1.22 billion.
  6. Your position. At 500 million tokens the API costs 500,000,000 × $0.000003 = $1,500, against $3,650 for the GPUs. Self-hosting costs $2,150 more per month at today's volume.

You need roughly 2.4 times your current volume before the hardware pays for itself (1,216.7 ÷ 500 = 2.43). The capacity check passes — 1.22 billion is comfortably under the 2.30 billion the deployment can serve at 35% — so the break-even is reachable rather than theoretical. If your utilisation were 15% instead of 35%, capacity would be 6,570 × 0.15 = 985.5 million, which is below the 1,216.7 million break-even, and no amount of demand would make this configuration beat the API without adding hardware or raising occupancy.

How to read the result

Compare your volume with the break-even, then check capacity. Being above break-even is necessary; being able to serve the traffic is also necessary. The calculator flags the case where break-even sits above capacity, which means the configuration cannot win on cost at any demand level. The fix is always one of three things: more GPUs, higher sustained throughput per GPU, or higher utilisation.

Treat the effective cost per million as the honest unit price. It is the number to put next to an API rate, because it already carries the utilisation penalty. A raw peak-throughput figure is a hardware specification, not a price.

Ask how much headroom the answer has. If self-hosting wins by 10%, it does not really win: the API side of the comparison has fallen steadily as models get cheaper, while your GPU rate is fixed by a contract or a purchase. A margin that thin is consumed by one price change or one month of low traffic. If it wins by three or four times, the decision is robust to both.

Remember what the comparison excludes on both sides. Self-hosting excludes the API's rate limiting, autoscaling, safety tooling, uptime commitments and the fact that nobody on your team has to be on call for it. The API excludes your ability to run a fine-tuned or gated model, to keep data inside your own network, and to control latency at the tail. Those are the reasons teams self-host that have nothing to do with the number on this page, and they are frequently the real ones.

Two adjacent levers usually beat the hosting decision outright on effort-to-saving. Caching a long static prefix costs an afternoon; size it with the prompt caching savings calculator. Cutting context length reduces both the API bill and the memory pressure on a self-hosted deployment; the KV cache size calculator shows how much VRAM a long context is consuming, which is often what caps your batch size and therefore your throughput.

Effective self-hosted cost per million tokens by utilisation

A $3,650-per-month deployment sustaining 2,500 tokens per second. At full occupancy it serves 2,500 × 3,600 × 730 = 6,570 million tokens a month; each row divides that by the utilisation shown, then divides the $3,650 bill by the result.
UtilisationTokens served per monthEffective cost per 1MVersus a $3.00 API rate
10%657 M$5.55561.85× dearer
25%1,642.5 M$2.22220.74× the API
35%2,299.5 M$1.58730.53× the API
50%3,285 M$1.11110.37× the API
75%4,927.5 M$0.74070.25× the API
100%6,570 M$0.55560.19× the API

The unit cost is inversely proportional to utilisation, so halving occupancy doubles the price per million. The 10% row is the one that turns a confident spreadsheet into a more expensive bill than the API it replaced.

Utilisation is not the same as uptime

A deployment can be up 100% of the month and utilised 20% of it. Uptime measures whether the service responds; utilisation measures whether the GPUs are generating tokens. Interactive traffic follows working hours and time zones, which means a deployment sized for the peak hour is idle for much of the night, and the hourly meter runs through all of it. Measure utilisation as tokens actually generated divided by tokens the hardware could have generated in the same period. If you are estimating rather than measuring, and your traffic is a single-region business-hours product, estimate low.

Assumptions and limits of this comparison

  • The GPUs are held continuously. A persistent serving deployment pays for 730 hours a month. If you can genuinely scale to zero overnight, model that as a lower GPU count or lower hours, not as higher utilisation.
  • Throughput is a single sustained number. Real throughput varies with prompt length, batch size and how much of the context is cached. The figure you enter should come from your own load test at your own prompt distribution.
  • Input and output tokens are treated alike. Prefill is compute-bound and decode is memory-bound, so a prompt-heavy workload behaves quite differently from a generation-heavy one. If your ratio is extreme, model the two phases separately.
  • The models are assumed comparable. A smaller open model at half the cost is only a saving if it does the job. Establish quality first, then compare prices.
  • No commitment discounts are modelled. Reserved or committed-use pricing lowers the hourly rate and raises the switching cost. Enter your contracted rate rather than the on-demand one if you have signed for capacity.
  • Nothing here prices the engineering. Building and running an inference platform consumes people. Put a realistic monthly figure in the operations field, because leaving it at zero systematically tilts the answer.

What to check before and after this calculation

Before you compare costs, size the deployment properly. A model that does not fit in the VRAM you have does not have a throughput number at all, and one that fits only without a KV cache will collapse at your real context length. The GPU VRAM requirement calculator gives the weights and activation footprint, and the KV cache calculator gives the term that grows with context and batch. Both feed the GPU count you enter here.

Quantisation changes the comparison materially, because it lets a model fit on fewer or cheaper GPUs and raises tokens per second on a memory-bound decode. The quantisation memory savings calculator shows the footprint at each precision; a model that drops from two GPUs to one halves the fixed bill and therefore halves the break-even volume.

After the calculation, run the sensitivity rather than the point estimate. Recompute with utilisation at half your assumption, with the API rate 30% lower than today, and with one extra GPU for redundancy. If self-hosting still wins under all three, the decision is sound. If it only wins under your best case, you are betting on your best case.

Finally, keep the unit economics in view. A cost per million tokens is an infrastructure number; what a chief financial officer asks about is cost per user. Feed the effective rate from this page into the cost per user per month calculator to see whether the hosting decision actually moves gross margin, or whether it moves a line that was never the constraint.

Frequently asked questions

What utilisation should I assume if I have not measured it?

Estimate from your traffic shape rather than picking a comfortable number. A single-region product used during business hours is busy for roughly a third of the week at best, and a deployment sized to hold latency at the peak hour is idle at every other hour. If you must guess, guess low and then run the calculator again at half that value to see whether the decision survives. Measuring is straightforward once you are live: divide tokens actually generated by throughput × elapsed seconds.

Why does the break-even volume not depend on throughput?

Because break-even compares two bills, and throughput does not appear in either. The fixed bill is hourly rate × GPUs × 730; the API bill is tokens × rate. Setting them equal gives a token volume that depends only on those terms. Throughput and utilisation matter one step later, when you ask whether your hardware can actually serve that volume. If it cannot, the break-even is unreachable and the calculator says so.

Should I count input tokens, output tokens, or both?

Count both, and use a blended API rate that matches the same mix. The subtlety is that the two phases behave differently on your own hardware: processing a prompt is compute-bound and fast per token, while generating a reply is memory-bound and slow per token. A workload that is 90% prompt tokens gets far more out of a GPU than the single throughput figure suggests, so measure throughput on your real prompt-to-output ratio.

Does self-hosting get cheaper if I buy the GPUs instead of renting?

It changes the shape of the cost rather than removing it. Convert the purchase into an amortised cost per GPU-hour — capital cost spread over the useful life, plus power, cooling, rack space and the share of hardware that fails — and enter that as the hourly rate. Owning also removes the ability to hand the hardware back when demand falls, which is the main financial risk this calculator does not model.

What does the operations cost field need to include?

Everything the GPU rate does not cover: model and dataset storage, network egress, a load balancer, metrics and log retention, an autoscaler if you have one, and a realistic share of the engineering time spent maintaining the stack. Leaving it at zero compares a raw GPU against a fully-managed service, which is not a like-for-like comparison and always favours self-hosting.

My volume is above break-even but the calculator warns about capacity. What does that mean?

It means the hardware cannot serve the traffic you have, so the cost comparison is moot until you resize. Either raise sustained throughput — larger batches, a quantised model, better scheduling — or add GPUs, which raises the fixed bill and therefore raises break-even too. Work out the configuration that serves the traffic first, then compare its cost against the API.

How much headroom should the answer have before I act on it?

Enough to survive the two things most likely to change: your utilisation being lower than assumed, and the managed API rate falling. Recompute with utilisation halved and the API rate cut by a third. A decision that still favours self-hosting under both is robust; one that flips under either is a bet on conditions holding still, and per-token prices have not held still.

Are there reasons to self-host that this calculator ignores?

Yes, and they are often the deciding ones. Keeping data inside your own network, running a fine-tuned or licence-restricted model, controlling tail latency, avoiding rate limits, and not depending on a single vendor are all real motivations that no cost model captures. This page tells you what those properties cost. It does not tell you whether they are worth it.

References