Self-Hosted LLM vs API Cost: 2026 Break-Even Math

Self-hosting an open-weight LLM only beats a pay-per-token API when your GPUs stay busy most of the month. Using list prices checked on November 13, 2026, an 8x H100 node serving gpt-oss-120b on AWS on-demand breaks even with the same model’s API at about 54% sustained load, and that assumes benchmark-level throughput. This guide shows the formula, the tables, and the costs most calculators leave out.

Prices checked: November 13, 2026 (US list prices, USD). GPU throughput from NVIDIA’s published TensorRT-LLM benchmarks. All monthly figures use 730 hours.

Rows of black server racks in a data center aisle
GPU nodes bill by the hour whether or not they serve traffic. Photo: imgix / Unsplash License

Is self-hosting an LLM cheaper than an API?

An API charges per token. A GPU charges per hour. That difference is the whole story. When traffic is steady and heavy, a rented GPU node can produce tokens for less than an API. When traffic follows business hours, spikes on launches, or drops at night, you keep paying for the node while it waits.

In the worked example below, one AWS p5.48xlarge node (8 NVIDIA H100 GPUs) serving the open-weight gpt-oss-120b model costs about $40,179 a month on-demand. The same model through a serverless API at $0.15 per million input tokens and $0.60 per million output tokens would cost about $73,873 for the node’s maximum benchmark output. So the node is cheaper only if it runs above about 54% of that maximum, every hour of the month.

Utilization here means the share of the node’s maximum token output you actually use across all paid hours. A node that is busy 10 hours a day on weekdays and idle the rest runs at roughly 30% utilization, even if it is fully loaded during those 10 hours.

The break-even formula

Write it in three steps:

  1. Monthly node cost = hourly price x 730 hours.
  2. Maximum monthly tokens = output tokens per second per GPU x number of GPUs x 3,600 x 730. Add input tokens at the ratio of your workload.
  3. API cost of that volume = (input tokens / 1M x input price) + (output tokens / 1M x output price).

Then divide step 1 by step 3. This version compares the same model on both sides, which keeps quality out of the math. If you compare a self-hosted open model with a frontier API model instead, the result tells you about price, not about whether the cheaper option is good enough for your task.

Input Value used Where it comes from
Hours per month 730 Standard cloud billing month
Workload shape 1,000 input / 1,000 output tokens per request Matches the benchmark row used below
Throughput per H100 4,685 output tokens/s NVIDIA TensorRT-LLM, gpt-oss-120b, FP8, max-load test
GPUs per node 8 AWS p5.48xlarge and Google Cloud a3-highgpu-8g
API price $0.15 input / $0.60 output per 1M tokens Together AI serverless gpt-oss-120b list price

Price and throughput inputs for 2026

Option (8x H100 node) Hourly price Per GPU-hour Monthly (730 h)
AWS p5.48xlarge, on-demand $55.04 $6.88 $40,179
Google Cloud a3-highgpu-8g, on-demand $88.49 $11.06 $64,598
Google Cloud a3-highgpu-8g, Spot $52.70 $6.59 $38,471
Google Cloud a3-highgpu-8g, 3-year commitment $38.86 $4.86 $28,371

The AWS figure comes from a third-party price tracker updated November 12, 2026; AWS’s own announcement confirms that P5 on-demand prices dropped 44% starting June 1, 2025, but AWS’s EC2 product page does not print a dollar figure. Google Cloud’s figures come from its accelerator-optimized pricing page and cover the whole VM, not just the GPUs. Spot prices can change daily, so treat that row as a snapshot.

For throughput, NVIDIA’s TensorRT-LLM performance page lists 4,685 output tokens per second per H100 for gpt-oss-120b at 1,000 input and 1,000 output tokens (FP8, four GPUs per replica). NVIDIA describes these runs as an offline maximum-throughput scenario where requests arrive with no delay. Your production numbers will be lower if you cap latency per user, run a less tuned serving stack, or see uneven traffic.

Close-up of a graphics card on a table, a reminder that self-hosted LLM vs API cost depends on GPU throughput
Benchmark throughput is a ceiling, not a promise. Photo: Christian Wiediger / Unsplash License

Break-even utilization by cloud and pricing model

The maximum output for one node is 4,685 x 8 x 3,600 x 730, or about 98.5 billion output tokens a month, plus the same number of input tokens in this workload shape. At the API’s list price, that volume would cost about $73,873.

Option Break-even at benchmark throughput With 0.25 engineer added If real throughput is 50% of benchmark
AWS on-demand 54.4% 58.2% 108.8% (API always cheaper)
Google Cloud on-demand 87.4% 91.3% 174.9% (API always cheaper)
Google Cloud Spot 52.1% 55.9% 104.2% (API always cheaper)
Google Cloud 3-year commitment 38.4% 42.2% 76.8%

The staffing column adds a quarter of one engineer’s time. The US Bureau of Labor Statistics lists a median annual wage of $135,980 for software developers (May 2025), so a quarter of that is about $2,833 a month before benefits. The 50% column is a sensitivity check, not a measurement.

Now apply a common traffic pattern. If the node is busy 10 hours a day on 22 weekdays, that is 220 of 730 hours, about 30%. Every row above needs more than 30% to break even, so a business-hours workload on one dedicated node costs more than the API in this example.

Option Cost per 1M input + 1M output at 100% load At 30% load API list price
AWS on-demand $0.41 $1.36 $0.75
Google Cloud on-demand $0.66 $2.19 $0.75
Google Cloud 3-year commitment $0.29 $0.96 $0.75

Costs that do not show up on the GPU bill

  • Redundancy: one node is a single point of failure. A second node for failover roughly doubles the fixed cost unless it also serves traffic.
  • Engineering time: someone has to patch drivers, tune batch sizes, update the serving engine and respond to incidents.
  • Commitment risk: a 3-year price is cheapest per hour, but you pay for the term even if a faster GPU or cheaper API arrives next year.
  • Quota and capacity: H100 capacity is not always available in every region on demand, so check quotas before you plan around it.
  • Evaluation: each model update needs a quality check against your own prompts before it goes live.

An API bundles all of this into the token price. That is why the comparison should be total cost of ownership, not GPU hours alone.

Fiber optic cables plugged into a network switch inside a server rack
Networking, storage and failover add to the self-hosted bill. Photo: Kirill Sh / Unsplash License

Which API are you really replacing?

Many teams start this analysis because a frontier API bill is large. But a self-hosted open-weight model is a different model. If your task truly needs a frontier model, the open model may not replace it. If it does not, a smaller hosted model may cut the bill without any GPUs at all.

Option Price per 1M input + 1M output Notes
Claude Haiku 5.5 (prompts up to 100K tokens) $0.60 Higher rates apply above 100K-token prompts
gpt-oss-120b serverless API $0.75 Together AI list price
Claude Sonnet 5.5 $12.00 $6.00 with the Batch API’s 50% discount
Self-hosted gpt-oss-120b, AWS on-demand, 30% load $1.36 From the table above, benchmark throughput

Two API features also move the line. Anthropic’s Batch API halves input and output prices for work that can wait, and prompt caching reads cost $0.10 per million tokens on Sonnet 5.5 versus $2 for fresh input. If much of your traffic is repeated context or overnight jobs, the API’s effective price may be far below its headline rate.

When self-hosting still makes sense

Situation Leans toward Why
Traffic mostly during business hours API About 30% utilization is below every break-even row above
24/7 steady volume above 50% of node capacity Self-host can win Fixed cost spreads across more tokens
Strict data residency or no internet access Self-host A requirement, not a price decision
Work that can wait hours Batch API 50% discount without managing GPUs
Frequent model upgrades wanted API No re-deployment or re-tuning work
Neatly organized network cables connected to a server patch panel
Steady, round-the-clock traffic is what makes fixed GPU capacity pay off. Photo: Taylor Vick / Unsplash License

Checklist before you buy GPU capacity

  1. Export one month of API usage and split it into input, output and cached tokens by hour.
  2. Calculate average and peak utilization a single node would see under that traffic.
  3. Benchmark your target model on your serving stack with your real prompt lengths and a per-user latency limit.
  4. Price at least three options: on-demand, Spot, and a 1- or 3-year commitment.
  5. Add a failover replica, engineering time, storage and egress.
  6. Re-run the API side with Batch API and prompt caching where your workload allows.
  7. Recheck list prices on the day you decide, since GPU and API prices both change often.
This article is general information based on public list prices, not procurement, financial or legal advice. Negotiated enterprise rates can change the result.

FAQ

At what volume does self-hosting an LLM become cheaper than an API?

It depends on GPU price, real throughput and the API you compare against. In this example, an AWS on-demand 8x H100 node must produce more than about 54% of its benchmark output every hour of the month to beat the gpt-oss-120b API. That is about 54 billion output tokens a month plus matching input.

How much does an H100 cost per hour in 2026?

As of November 13, 2026, list prices work out to about $6.88 per GPU-hour on AWS on-demand (p5.48xlarge) and about $11.06 on Google Cloud on-demand (a3-highgpu-8g). Google Cloud’s 3-year commitment brings it to about $4.86. Specialist GPU clouds often list lower hourly rates.

Is a Spot GPU instance good for LLM inference?

Spot can be cheaper, but the provider can reclaim the instance and prices can change daily. It suits batch jobs or extra capacity behind a stable baseline, not a single node that serves all production traffic.

Does prompt caching change the self-hosted LLM vs API cost math?

Yes. On Claude Sonnet 5.5, cache reads cost $0.10 per million tokens versus $2 for standard input. If a large share of your input is repeated context, the API’s effective price drops, which raises the utilization a self-hosted node needs to compete.

Why are benchmark throughput numbers higher than what I see in production?

NVIDIA’s published numbers come from a maximum-load test with requests queued back to back. Production systems often limit latency per user, use different prompt lengths and see uneven traffic, all of which lower sustained tokens per second.

2 thoughts on “Self-Hosted LLM vs API Cost: 2026 Break-Even Math”

  1. Pingback: Claude Prompt Caching Cost: 5-Minute vs 1-Hour Math

  2. Pingback: AWS Pricing Calculator vs Real Bill: 6 Costs It Misses

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top