AI API vs Self-Hosted LLM: Where Is the Break-Even Point?
An AI API lets a team start without operating inference infrastructure. A self-hosted model gives that team more control over the serving environment, but also responsibility for capacity, availability and maintenance.
There is no universal monthly token count at which self-hosting becomes cheaper. The answer depends on the model that meets your quality requirements, the shape of your requests, the price of capacity and how much of that capacity you use.
The right comparison is the cost of delivering an acceptable result at an acceptable latency. A cheap response that fails the task is not an equivalent product.
Start with the whole system cost
FinOps Foundation's recent AI Spend Budget Busters discussion highlights costs beyond model consumption, including idle infrastructure, evaluation work and telemetry. That is a useful starting point for an API-versus-hosting decision: account for the system surrounding inference.
On the API side, include input and output tokens, retries, additional model calls, embeddings and any separately billed tools. On the hosting side, include compute, storage, network, monitoring, maintenance and the spare capacity required by your reliability target.
Shared costs should be counted on both sides or excluded from both. An application database used identically in either design does not make one inference option more expensive than the other.
Calculate a request before calculating a month
For a basic text request with no cache discount or separate tool charges:
API request cost = (input tokens × input price + output tokens × output price) / 1,000,000
In this formula, prices are USD per million tokens. Input and output must be calculated separately.
Consider an illustrative request with 2,000 input tokens and 500 output tokens. Assume an API price of $1 per million input tokens and $4 per million output tokens. The request costs $0.002 for input and $0.002 for output, or $0.004 in total.
These are invented planning rates, not a quotation for any named model or provider. The example excludes caching, batch discounts, retries and tool charges so the arithmetic remains visible. Substitute the current price and your actual request distribution.
| Monthly requests | Input tokens | Output tokens | Illustrative API cost |
|---|---|---|---|
| 10,000 | 20 million | 5 million | $40 |
| 100,000 | 200 million | 50 million | $400 |
| 250,000 | 500 million | 125 million | $1,000 |
| 500,000 | 1 billion | 250 million | $2,000 |
For an agent that calls the model several times per task, count every call. A user clicking one button does not necessarily create one billable inference request.
Build the self-hosted monthly floor
Assume one inference server costs $0.80 per hour and is reserved for the full month. Using 730 hours as a planning convention, compute costs $584. Add $66 for storage, network and monitoring, plus five hours of operations at $50/hour.
The result is $650 of infrastructure expense and $250 of staff-time value, or $900 per month. The hourly figure is an illustrative whole-server assumption. It does not identify a GPU, promise model compatibility or establish achievable throughput.
This model assumes a single inference instance. It provides no dedicated failover instance. Model licensing, migration and initial evaluation costs are excluded; add them if applicable. Month lengths differ, so replace 730 with actual billable hours for an invoice forecast.
At 225,000 requests, this example represents 450 million input tokens and 112.5 million output tokens. It is an arithmetic intersection, not a deployment recommendation.
Check whether the server can deliver the workload
The financial model is useful only if the proposed configuration can deliver the target quality and latency. At 225,000 requests across 730 hours, the average arrival rate is about 0.086 requests per second. Average output demand is about 42.8 tokens per second across all requests.
Those averages hide peaks, input-processing work and concurrency. They also say nothing about time to first token or the speed experienced by an individual user. A server can meet a monthly volume target and still produce unacceptable queues during business hours.
Evaluate candidate models on representative tasks first. Then load-test the selected model, quantization and serving configuration with realistic prompt lengths, output lengths and arrival patterns. Record task success, p95 latency, time to first token, errors and sustainable throughput. vLLM provides serving benchmark tooling that can support this process; synthetic throughput alone is not a substitute for your own workload.
If capacity requires another instance, the hosting cost becomes a step rather than a flat line. If peak demand dominates, an API or a hybrid design may be more economical than paying for idle spare capacity.
See how easily the threshold moves
Keep the same $900 monthly hosting cost but change the effective API cost per request:
| Effective API cost per request | Arithmetic monthly break-even |
|---|---|
| $0.002 | 450,000 requests |
| $0.004 | 225,000 requests |
| $0.008 | 112,500 requests |
If high availability requires two of the assumed $584 compute instances, while the $66 overhead and $250 operations allowances stay unchanged, the optimistic monthly total becomes $1,484. At $0.004 per API request, the intersection moves to 371,000 requests. Real redundancy may also increase storage, networking and operational work, so this is a lower-complexity illustration, not a complete HA design.
Compare successful tasks, not just tokens
Different models may produce different token counts and success rates for the same business task. Define acceptance criteria before comparing prices: correct extraction fields, usable code, grounded answers or a human-reviewed support response.
Use total inference-system cost / successfully completed tasks as one business metric. Include failed attempts and retries in the numerator. Also track latency and failure severity: a lower unit cost is not enough if the output is unusable.
A self-hosted model may be a good fit for repetitive, well-defined tasks with steady demand. An API may be preferable for variable traffic or tasks requiring capabilities the candidate hosted model cannot meet. A hybrid approach can route routine tasks to a smaller hosted model and difficult or overflow work to an API, provided the routing and evaluation costs are included.
Make the decision with a short pilot
Collect a representative request sample without exposing sensitive production data. Measure token usage and task success with the API. Test a suitable hosted model against the same acceptance criteria. Then benchmark peak demand and calculate the complete monthly budget for both options.
Choose self-hosting when quality, capacity, operations and economics all work together. Choose the API when it delivers better value for the workload. Revisit the decision when demand or model pricing changes materially.
Next step: Read our Ollama versus vLLM guide, then explore NexNodo for infrastructure candidates to benchmark. Confirm model requirements, GPU memory and actual availability before selecting a configuration.
Sources and methodology
- FinOps Foundation — AI Spend Budget Busters: total-cost context.
- vLLM — Serving benchmark reference: benchmarking reference.
- All rates, request sizes, costs and break-even figures are original illustrative assumptions. They are not model performance measurements or live supplier quotes. The graphics assume no incremental per-request hosting charge and sufficient capacity; change the formula if either assumption fails.
- Sources checked on 22 October 2026.