A founder sees that an open-weight model is free to download, sees the API bill growing, and asks the obvious question: why are we paying per token? The honest answer to self-hosted LLM vs API is that it depends on one number most teams never measure, GPU utilisation. This post gives you a method to find your own break-even with your own figures, instead of trusting anyone's headline price comparison, including ours.
Why is the per-token price comparison misleading?
Because the two options are priced on different axes. An API charges for tokens actually processed and nothing when you are idle. A GPU you rent or own charges for time, whether it is busy or not. So the comparison is not "price per million tokens" against "price per million tokens". It is a pay-per-use cost against a fixed cost whose per-token price depends on how full you keep it.
If your traffic is spiky, say a business-hours internal tool, the GPU sits idle most of the day and the effective per-token cost is far higher than the hardware's best case. If traffic is steady and heavy, the fixed cost is spread thin and self-hosting can win.
How do you calculate the break-even?
Use your own numbers in this order. We deliberately give no prices here because they change often; take current ones from your provider's pricing pages.
- Monthly API cost today: pull it from your usage dashboard, split by feature.
- Monthly self-hosting cost: GPU instances needed to meet your peak load and latency target, multiplied by hours (all of them, not just busy ones), plus a second instance if you need redundancy, plus storage and networking.
- People cost: the fraction of an engineer's month spent on serving, monitoring, upgrades and incidents, priced at what that engineer costs you.
- Quality adjustment: if the open model needs more tokens, more retries or a human-review step to reach the same pass rate, add that cost.
Self-hosting wins only if (2) + (3) + (4) is lower than (1) for the traffic you will have, not the traffic you hope for.
| Factor | API | Self-hosted open-weight model |
|---|
| Cost when idle | Zero | Full GPU cost |
| Cost shape | Variable, scales with usage | Mostly fixed, step changes when you add GPUs |
| Capacity planning | Provider's job, subject to rate limits | Yours: peak load, batching, autoscaling |
| Reliability | Provider SLA plus your fallback | Yours: redundancy, on-call |
| Model upgrades | Change a model ID (see deprecation planning) | Re-evaluate, re-deploy, re-tune serving |
| Data leaves your environment | Yes, under provider terms | No |
| Best fit | Variable or early-stage traffic | Steady high volume, strict data control |
What costs do teams forget?
- Redundancy. One GPU box is a single point of failure. A production service usually needs at least two, which can double the fixed cost.
- Evaluation. You must prove the open model meets your quality bar on your task. That means an eval set and time; see LLM evals in CI.
- Serving engineering. Batching, quantisation choices, context-length limits and autoscaling are real work, and not a one-off, because models and serving software keep changing.
- Lost provider features. Hosted APIs often bundle things like prompt caching and batch discounts. Reproducing them yourself costs time. Compare against your bill after applying the levers in how to reduce LLM API costs, not against the unoptimised bill.
That last point matters most: many teams compare self-hosting with their naive API spend. If caching and model routing already cut that spend, the gap you are trying to close shrinks.
When does self-hosting make sense anyway?
Cost is not the only reason, and sometimes it is not the main one:
- Data control. Contracts or regulation may restrict sending certain data to a third party. Before concluding you must self-host, check whether redacting PII before the API call or a provider's regional or zero-retention options meet the requirement. For Indian products, see how the DPDP Act affects this.
- Offline or air-gapped deployment. If the product must run without internet, an API is not an option.
- Narrow, high-volume tasks. Classification or extraction at large scale is where a small model is most likely to match a large one on quality, and where latency control pays off.
For open-ended reasoning, long documents or agentic tasks, the gap between frontier API models and what you can run yourself is more likely to show up in your quality metrics.
A sensible path
Start on an API. It lets you learn real traffic patterns and which features carry volume. Build your eval set and a thin model-abstraction layer from day one, so switching is a config change. Once a single high-volume, narrow feature shows steady load, test an open-weight model on that one feature against your eval set, and run the break-even above with real figures. A hybrid, where the API handles hard and rare requests and a self-hosted small model handles the bulk, is often the end state rather than an all-or-nothing choice. The reasoning is the same as in build vs buy for AI features.
What to do next
- Export your last three months of API usage by feature.
- Identify any feature with steady, high volume and a narrow task.
- Build an eval set for it and score one or two open-weight candidates.
- Run the break-even with current prices, redundancy and people cost included.
If you want a second pair of eyes on that analysis before committing to GPUs, see how we approach AI SaaS development.
Frequently asked questions
- Is self-hosting an LLM cheaper than using an API?
- Only when a GPU stays busy. An API charges per token and costs nothing when idle; a rented or owned GPU costs the same whether it serves one request or a thousand. Self-hosting tends to win on steady, high-volume, predictable workloads and lose on spiky or low-volume ones.
- What costs do teams forget when comparing self-hosting to an API?
- Engineering and on-call time, redundancy (a second instance so one failure is not an outage), idle capacity, evaluation of the open model against your task, and the work of upgrading when a better model is released.
- Are there reasons to self-host other than cost?
- Yes. Data residency or contractual limits on sending data to a third party, offline or air-gapped deployment, and control over model versions can justify self-hosting even when it costs more.
- How do I compare an open-weight model with an API model fairly?
- Run both against the same evaluation set built from your real inputs, with pass criteria defined in advance, and compare quality, latency and cost per successful task, not per token.