GPU vs API Cost
Break-even analysis for self-hosting GPUs versus paying per-token APIs.
In plain words
Paying per use costs less when you use the AI a little, and owning your own computers costs less when you use it a lot, so you work out where the two lines cross.
Think of it like…
Taxi versus owning a car: a taxi is cheaper if you ride rarely, a car is cheaper if you drive daily, but only if you count parking, insurance, maintenance and the time you spend on all of it.
Where you’ve seen it
A feature handles 50,000 requests a day with 3,100 input and 420 output tokens each: 155M input and 21M output tokens daily. A comparable hosted open-model API charges an illustrative $0.90 per million tokens in and out, so $158.40 a day. Self-hosting that model on GPUs that prefill at 8,000 tokens per second and decode 914 tokens per second at the latency target needs 155M ÷ 8,000 = 19,375 s plus 21M ÷ 914 = 22,976 s, or 11.76 GPU-hours of pure compute a day. At a realistic 60% average utilisation that is 19.6 GPU-hours, 0.82 of a GPU, but redundancy requires at least 2 GPUs running 24 hours: 2 × 24 × $3 = $144 a day, plus 0.25 of an engineer at $180,000 a year ($123 a day), so $267 versus $158: the API wins. At 250,000 requests a day the API costs $792 while self-hosting needs 98 GPU-hours (5 GPUs, $360) plus the same $123, so $483: self-hosting wins by $309 a day. The break-even is about 84,000 requests a day, and it moves with utilisation, GPU price and the quality gap to a frontier API (which at $2.50 and $10 per million would cost $597.50 a day at 50,000 requests).
Words you’ll hear
- Break-even volume
- The usage level at which self-hosting and API total costs are equal.
- Utilisation
- The share of paid GPU time actually used for useful work.
- Redundancy floor
- The minimum number of GPUs needed for availability regardless of load.
- Ops overhead
- Engineering time for deployment, scaling, upgrades, monitoring and on-call.
Visual diagram
Theory & deep dive
Building the cost model
API side: daily cost = input tokens × input price + output tokens × output price, with discounts from caching or batch tiers. Self-hosted side: measure real per-GPU throughput for your model, precision and latency SLO (prefill tokens per second and decode tokens per second at the chosen batch size; see the throughput lesson), convert daily tokens to GPU-seconds, divide by an achievable utilisation (traffic is diurnal and bursty, so 40% to 70% is typical for interactive services), then round up to whole GPUs and apply a redundancy floor (two replicas so one failure or deploy doesn't take you down). Add GPU price per hour (on-demand, reserved or committed discounts), networking and storage, monitoring, and the people cost of running a serving stack.
Make the comparison at equal quality: an open 70B model hosted yourself should be compared with an API for that model class, or your eval set must show it meets the product's quality bar. If you need frontier capability, no self-hosted option may qualify, and the question becomes API pricing tiers and caching instead. Self-hosting can also be driven by non-cost reasons: data residency or privacy, latency control, customisation (fine-tuned or LoRA models) and avoiding rate limits or vendor dependence; price these in, but keep them separate from the dollar break-even.
Prefill: 155,000,000 ÷ 8,000 tokens/s = 19,375 s. Decode: 21,000,000 ÷ 914 tokens/s = 22,976 s. Total 42,351 s = 11.76 GPU-hours. At 60% utilisation: 19.6 GPU-hours, about 0.82 GPU on average, but with two replicas minimum you pay for 48 GPU-hours a day.
Break-even, sensitivity and decisions
With the numbers above, self-hosting costs = $72 × N GPUs (N = max(2, ⌈volume × 0.82⌉)) + $123 ops, against an API cost of $158.40 × volume (in units of 50,000 requests a day). At 1×: $267 versus $158. At 1.5×: N = 2, $267 versus $238. At 2×: N = 2, $267 versus $317 (self-hosting is already cheaper). The crossover is $267 ÷ $158.40 = 1.69×, about 84,000 requests a day. At 5× it's $483 versus $792. Note the step shape: self-hosting cost is flat until you need another GPU, so under-utilised fixed capacity makes small workloads expensive.
Run a sensitivity analysis: at 30% utilisation, GPU needs double and break-even rises; with reserved GPUs at $2 an hour, break-even falls; if ops need a full engineer ($493 a day), break-even moves far higher; if API prices drop 50% (which has happened repeatedly), the case weakens. Consider hybrids: serve the stable high-volume base load on owned GPUs and burst or long-tail requests to an API; use APIs for prototyping and switch when volume and requirements stabilise; and revisit the decision regularly. Include risk: capacity shortages and GPU lead times, upgrade effort when better open models appear and the cost of an outage on a single-vendor API versus your own stack.
Base: break-even ≈ 84,000 requests/day. With reserved GPUs at $2/h the fixed cost falls to $96 + $123 = $219, so break-even ≈ 69,000/day. With a full-time engineer on the stack (+$370/day), self-hosting at the 2-GPU floor costs $637, and break-even moves to about 270,000 requests a day (5 GPUs at $360 plus $493 = $853 against an API cost of $158.40 per 50,000 requests).
How it works, step by step
Step 1 of 41. Fix the workload and quality bar
Estimate daily input and output tokens at peak and average, and choose the model that meets the quality bar.
- Compare
- at equal quality
When to use it & trade-offs
What it is
GPU versus API cost analysis compares paying a provider per token against running your own GPUs. The API cost is simple (tokens × price). The self-hosted cost has to include GPU-hours for the capacity you actually need (peak load, redundancy and utilisation, not average load), engineering and operations time, storage, networking and the cost of being slower to adopt new models. The comparison must be made at equal quality (the open model you can host versus the API model you'd otherwise use) and produces a break-even volume below which the API is cheaper and above which self-hosting wins.
Why it matters: Per-token prices look cheap until volume grows, and GPU prices look cheap until you count idle time, redundancy and engineers. Teams often self-host too early (paying for idle GPUs and operations) or too late (paying a large API bill for a stable, high-volume workload). A break-even model with explicit utilisation and ops assumptions turns an emotional debate into a decision with sensitivity ranges.
When to reach for it
- Deciding whether to adopt open models in-house
- Budgeting for scale-up of a successful AI feature
- Evaluating reserved GPU commitments
When to avoid or be careful
- Comparing GPU price per hour with API price per token without utilisation
- Ignoring redundancy and on-call costs
- Comparing a weaker self-hosted model with a frontier API
Hosting options
Strengths: No fixed cost; elastic; no ops.
Watch out: Cost scales linearly; rate limits and data sharing.
Strengths: Lower unit cost at scale; control.
Watch out: Fixed cost, utilisation risk and operations burden.
Strengths: Good utilisation and resilience.
Watch out: Two stacks to maintain and keep consistent.
Interview signals & numbers to know
When this topic comes up
- “Should we host our own model?”
- “Our API bill is growing fast”
- Break-even analysis
- GPU utilisation
- Reserved capacity
Benchmarks & rules of thumb
- $267 vs $158
- self-host vs API per day at 50,000 requests
- $483 vs $792
- self-host vs API per day at 250,000 requests
- ~84,000/day
- break-even requests per day in the example
Common mistakes & follow-ups
Common interview mistakes
- Assuming 100% GPU utilisation.
- Forgetting that you need at least two replicas for availability.
- Treating engineers' time as free.
Likely interviewer follow-ups
- How would you decide between an API and self-hosting?
- What affects the break-even volume most?
- When does a hybrid approach make sense?
Knowledge check
Put it into practice
Practice related interview Q&A
Apply GPU vs API Cost with generative AI interview Q&A and hands-on practice.