Self Hosted LLM vs API Cost: A Practical IT Guide

November 7, 202610 min read

Self-hosted LLM vs API cost depends mainly on workload volume, utilization, and the fixed cost of GPUs and operations. For most variable or modest workloads, an API is cheaper because you pay for tokens used and nothing when the system is idle; self-hosting becomes more credible when inference runs continuously at high volume.

That answer is more useful than comparing a cloud token price with the purchase price of one GPU. An IT leader must compare the full operating model: input and output tokens, caching, web-search calls, idle capacity, failover, observability, upgrades, electricity, and staff time. The right choice is therefore a capacity and service decision, not only a model-price decision.

What is the difference between a self-hosted LLM and an API?

An API lets an organization send requests to a model provider and pay according to usage. The provider operates the model-serving infrastructure, absorbs idle capacity, and manages model upgrades. OpenAI’s pricing documentation also states that the Responses API, Chat Completions API, Realtime API, Batch API, and Assistants API are not priced separately, so the API surface itself is not an additional pricing layer.

Advertisement

Self-hosting means the organization operates the inference environment. That may include GPUs, electricity, deployment, monitoring, failover, upgrades, and the people needed to keep the service available. The cost is largely fixed over a period of time, even when application demand is low. Xinference’s comparison describes the central trade-off clearly: APIs charge for input and output tokens and cost nothing when idle, while self-hosting turns GPUs and staff into fixed monthly costs.

How much does an LLM API cost?

API cost is usually calculated from input tokens and output tokens, with some services adding separate charges for tools or other usage. The difference between input and output pricing can be substantial, so an application that produces long responses may cost more than one that receives long documents but returns short answers. Cached input can also have a separate rate where the provider offers it.

For example, OpenAI’s API pricing page lists GPT-6 Astra at $10.00 per one million input tokens, $1.00 per one million cached input tokens, and $50.00 per one million output tokens. These figures show why a budget should model prompt and response tokens separately rather than applying one average token rate to every request. The relevant OpenAI API pricing page should be treated as the source for those listed rates.

Additional tools can change the calculation. OpenAI’s platform pricing page lists web search at $10.00 per 1,000 calls, with search content tokens billed at model rates. An application that uses web search therefore has both a call charge and token usage to account for. The cost model should include those calls as a separate line item rather than hiding them inside a general API estimate.

For an initial estimate, use the KrypTunes AI Cost Calculator and separate the following inputs:

  • Input tokens per request and output tokens per request
  • Requests per day or month
  • Cached input, if applicable
  • Web-search or other tool calls
  • Expected growth in traffic
  • Idle periods and traffic variability

What does self-hosted LLM cost include?

Self-hosted LLM cost includes more than the GPU. Hardware is the visible purchase, but the operating model also includes electricity, capacity planning, failover, observability, maintenance, and upgrades. Staff time matters because someone must operate the inference service and respond when performance, capacity, or reliability changes.

A useful way to think about this is fixed cost divided by productive output. If a GPU is busy only occasionally, its cost is spread across relatively few tokens. If the same hardware is kept busy with a sustained workload, the cost per token can fall. This is why self-hosting can look expensive in a low-utilization environment and more attractive in a high-utilization environment.

Pulsed Media gives one concrete reference point: a single RTX Pro 6000 costs $8,500, and that hardware plus electricity buys more than 200 million tokens of Claude Sonnet API at the pricing used in its analysis. The comparison does not mean that every organization should use an API; it demonstrates that a hardware purchase must be justified by enough sustained usage to recover its cost. Its analysis places cheaper local inference at roughly 10–20 million sustained tokens per day, describing that workload as bulk batch processing rather than chat.

When is self-hosting cheaper than an API?

Self-hosting is more likely to win when token demand is high, predictable, and sustained. It is less likely to win when traffic is intermittent, request volume is small, or the organization would need to keep expensive hardware available for occasional peaks. The same GPU can have very different economics depending on how fully it is utilized.

Vercel’s H100 concurrency benchmark illustrates the utilization problem. In its test, Mixtral 8x7B cost $15.25 per million output tokens at one request per second and $0.87 per million output tokens at saturation on the same hardware. That is a 17.5-times difference caused by workload concurrency, not by changing the hardware. The Vercel analysis concludes that a managed API wins for most workloads because the provider absorbs idle capacity and model upgrades.

Tencent Cloud’s break-even analysis places the break-even zone around 50,000 tokens per day per model after including failover, operations, observability, and upgrade costs. It also describes 0–10,000 tokens per day as typically costing cents per day on an API, with self-hosting losing badly because GPUs sit idle. These figures should be used as planning reference points, not as universal thresholds, because model size, hardware, traffic shape, and operating requirements affect the result.

Self-hosted LLM vs API cost comparison

The following comparison focuses on the cost behaviour an IT delivery leader must manage rather than treating either approach as universally cheaper.

Cost or operating factor API Self-hosted LLM
Billing model Variable charge for input and output tokens Fixed infrastructure and operating cost spread over usage
Idle workload No token charge when idle GPUs and staff remain a cost while idle
Small or irregular demand Usually favourable Often unfavourable because capacity is underused
Sustained batch workload Can become costly at high volume Can become favourable at high utilization
Capacity management Provider absorbs idle capacity and service demand variation Organization must size and operate capacity
Model upgrades Provider absorbs upgrade work in the managed service Organization owns upgrade planning and execution
Failover and observability Must be understood in the provider and application design Must be included directly in the operating cost
Tool usage May add call charges and model-token charges Depends on the tools and architecture operated by the organization

How should an IT leader calculate the break-even point?

Start with the API baseline. Estimate monthly input tokens, output tokens, cached input, and tool calls. Keep the categories separate, because output pricing and web-search charges can materially change the result. Use a range rather than one forecast: low demand, expected demand, and sustained high demand.

Then build the self-hosted case. Include the GPU purchase or rental cost, electricity, deployment effort, monitoring, failover, upgrades, and staff capacity. Divide the total cost by the number of productive tokens the environment can process during the period. Do not use peak throughput as the main assumption unless the workload can reliably sustain that level.

Finally, compare service requirements. A lower token cost is not enough if the workload needs capacity that is unavailable, difficult to upgrade, or expensive to support. Conversely, an API may be the wrong fit when a predictable batch workload keeps local infrastructure busy and the organization can operate it without adding disproportionate delivery risk.

Which workloads favour an API?

APIs generally suit applications with variable demand, modest usage, short pilots, and workloads that may change model or capacity requirements. They also fit teams that want to avoid operating GPUs and absorbing the cost of idle capacity. This model makes budgeting directly proportional to use, although the team still needs controls for token growth and tool calls.

Chat and interactive applications often have uneven demand, which makes utilization difficult to guarantee. That does not make self-hosting impossible, but it means the infrastructure case must account for peaks without assuming that peak capacity will be continuously productive. For operational planning, measure actual request patterns before committing to hardware.

Which workloads favour self-hosting?

Self-hosting is more plausible for sustained, predictable workloads that can keep infrastructure busy. Pulsed Media specifically describes the 10–20 million-token-per-day range as a profile for bulk batch workloads rather than chat. Batch processing can make capacity planning easier because work can be scheduled and grouped instead of arriving unpredictably.

The decision also depends on whether the organization can absorb the operational work. A self-hosted deployment needs ownership for monitoring, failover, upgrades, and capacity. If those responsibilities require a separate team or create delivery risk, the apparent token savings may not be the lowest total cost.

How can teams reduce LLM operating cost?

First, measure before migrating. Track input and output tokens, cacheable prompts, tool calls, concurrency, and idle periods. A simple usage record can reveal whether the main issue is model pricing, excessive output, low utilization, or an unexpectedly large number of search calls.

Second, separate interactive and batch workloads. Interactive traffic may benefit from the elasticity of an API, while sustained batch work may justify a self-hosted capacity calculation. Treating both workloads as one average can conceal the utilization pattern that determines the economics.

Third, review the estimate regularly. Model prices, application traffic, and infrastructure assumptions can change, and self-hosted systems require upgrade planning. KrypTunes’ AI Uptime tracker can support the operational side of the decision by keeping service reliability visible alongside cost.

FAQ: self-hosted LLM vs API cost

Is an API always cheaper than self-hosting an LLM?

No. An API is usually favourable for small, variable, or idle-heavy workloads, while self-hosting can become cheaper for sustained, high-volume workloads. The result depends on utilization and the full operating cost, not only the advertised token rate.

What is the main hidden cost of self-hosting?

The main hidden cost is unused capacity combined with operational work. GPUs, electricity, failover, observability, upgrades, and staff remain part of the cost even when demand is low.

Does output-token pricing matter more than input-token pricing?

It can. The listed GPT-6 Astra rates show output tokens priced higher than input tokens, while cached input has a lower listed rate. Applications that generate long responses should therefore forecast output separately.

When should a team choose an API first?

Choose an API first when demand is uncertain, traffic is intermittent, the workload is modest, or the team does not want to operate GPU infrastructure. Revisit self-hosting after measuring sustained volume and concurrency rather than assuming a hardware purchase will lower cost.

Advertisement