AI Cost: API vs Self-Hosted LLMs, and the Breakeven (2026)
API or self-hosted LLM? A clear cost breakdown, the breakeven that decides it, and why falling inference prices change the maths. Illustrative figures inside.
TL;DR
- There is no fixed answer. API wins at low and medium volume; self-hosting can win at high, steady volume or when data cannot leave your environment.
- API cost is per token: zero infrastructure, pay for what you use, frontier quality on tap. Self-hosting is a mostly fixed GPU and engineering bill regardless of usage.
- The breakeven is a volume line. Below it, per-token API pricing is cheaper. Above it, flat GPU cost per hour spreads across enough tokens to beat the API.
- Do not forget the hidden costs of self-hosting: GPUs, DevOps time, scaling, uptime and model updates. The sticker price of a GPU is not the total.
- Inference is getting cheaper fast. The Stanford AI Index 2025 recorded the price of GPT-3.5-level quality falling from 20 dollars to 0.07 dollars per million tokens in about 18 months, which keeps pushing the breakeven upward and favours APIs for most teams.
The two options, defined
An API model is hosted by a provider such as OpenAI, Anthropic or Google and billed per token, with no infrastructure to run. A self-hosted model is an open-weight model such as Llama, Mistral or Qwen that you run on your own or rented GPUs, paying for the hardware and the engineering to operate it, whatever your usage.
API or self-hosted: which is cheaper?
It depends on volume and constraints, and anyone who gives you a flat answer is selling something. API pricing is variable: you pay per token, so cost tracks usage and starts at zero. Self-hosting is fixed: you pay for GPUs and the people to run them whether you serve a thousand requests or a million. The right choice is wherever those two curves cross for your workload.
What you actually pay for, on each side
| Cost | API model | Self-hosted open model |
| Per request | Per-token fee | Effectively zero once running |
| Infrastructure | None | GPUs, hosting, networking, storage |
| Engineering | Minimal integration | Setup, scaling, uptime, updates |
| Scales with | Usage | Peak load you provision for |
| Starts at | Near zero | A fixed monthly floor |
The table is the whole argument. An API converts AI into a variable cost that starts small and grows with success. Self-hosting converts it into a fixed cost you carry from day one, which only pays off once usage is large and steady enough to amortise it.
How the breakeven works
Picture two lines on a graph of cost against monthly tokens. The API line starts at zero and slopes up with usage. The self-hosted line starts high, at your fixed GPU and operations cost, and stays nearly flat as usage grows. They cross at a breakeven volume. Below it, the API is cheaper. Above it, self-hosting wins because that flat cost spreads across more and more tokens.
The breakeven is a moving target
Falling API prices push the breakeven higher, meaning you need ever more volume to justify self-hosting. The Stanford AI Index 2025 recorded inference for GPT-3.5-level quality dropping from 20 dollars to 0.07 dollars per million tokens in roughly 18 months, a 280-fold fall. Hardware costs dropped about 30% a year and energy efficiency improved about 40% a year over the same period. Recompute the breakeven before you commit; last year's number is already stale.
When self-hosting actually wins
Set cost aside for a moment, because three of the four reasons to self-host are not about price.
- Data privacy: Regulated data in healthcare, finance or legal that legally cannot leave your environment. This alone can decide it, whatever the cost.
- High, steady volume: Predictable heavy traffic that sits well above the breakeven, so flat GPU cost beats per-token pricing.
- Control and customisation: You need to fine-tune weights, pin an exact version, or stop a provider changing the model under you. For architectural decisions like whether to train or augment, check our guide on RAG versus fine-tuning.
- Latency or offline: Edge or on-premise deployments where an external API call is too slow or not permitted.
For more guidance on choosing between closed APIs and open-weight models, see our analysis of choosing the right AI model.
The hidden cost of self-hosting
The GPU bill is the visible number. The real total includes DevOps engineers to run the cluster, provisioning for peak load so you are paying for idle capacity most of the time, the on-call burden of keeping inference up, and the ongoing work of updating models as better open weights ship. Many teams that self-host to save money discover the engineering time costs more than the API ever would. When integrating LLMs into production, these operational burdens are often what slow teams down.
A practical recommendation
- Start on an API. Validate the product before you spend a cent on infrastructure.
- Instrument token usage from day one so you know your real volume, not a guess.
- Model the breakeven with current API prices and current GPU costs, including engineering time.
- Only move to self-hosting when volume is high and steady, or when privacy requires it, not on principle.
- Abstract the model behind your own interface so switching from API to self-hosted is a config change, not a rebuild.
Every figure here moves with model, provider, GPU market and your own traffic, so treat any specific number as illustrative until your workload is measured and scoped.
For context on full system investments, see our breakdown of what it costs to build an AI agent or explore our real-world case study on the EcomSource AI product-data platform build. You can also view our core AI development and AI agents services.
Trying to model your AI running costs?
Parallel Loop runs the breakeven for your real volume and picks API or self-hosted on the maths, not on hype. Book a free scoping call and we will size the most cost-effective way to run your AI.
Parallel Loop pricing (USD): AI Agent Development from $10,000. MVP plus AI feature from $10,000. Custom enterprise AI builds quoted on scope.
Frequently Asked Questions
Is an LLM API or self-hosting cheaper?
At low and medium volume, an API is almost always cheaper because you pay per token with no fixed infrastructure. Self-hosting only wins at high, steady volume above the breakeven, or when data privacy requires keeping the model in your own environment.
What is the breakeven between API and self-hosted AI?
It is the monthly token volume where flat self-hosting cost equals variable API cost. Below it the API is cheaper; above it self-hosting wins. Because API prices keep falling, the breakeven keeps rising, so recompute it with current prices before deciding.
When should I self-host an LLM?
Self-host when regulated data cannot leave your environment, when you have high and predictable volume above the breakeven, when you need to fine-tune or pin an exact model version, or when latency and offline requirements rule out an external API. Otherwise an API is simpler and usually cheaper.
What are the hidden costs of self-hosting an LLM?
Beyond GPUs, you pay for DevOps engineers, provisioning for peak load, uptime and on-call, and ongoing model updates. These operational costs often exceed the API bill they were meant to replace, which is why self-hosting to save money frequently backfires at smaller scale.
Are AI inference costs going up or down?
Down, sharply. The Stanford AI Index 2025 recorded inference for GPT-3.5-level quality falling from 20 dollars to 0.07 dollars per million tokens in about 18 months. Falling prices favour APIs and push the self-hosting breakeven higher over time.