Self-Hosted GPUs or an API? An LLM Cost-per-Million-Tokens Calculator

An LLM inference cost calculator for self-hosted GPUs vs. an API. At 2026 H100 prices, an API wins for a 70B model unless GPUs stay 93% busy.

Line chart of LLM inference cost per million tokens against GPU utilization for a self-hosted H100, crossing the $1.04 API price only at 92.7% utilization and never reaching the $0.72 price

The LLM inference cost question is a utilization question

Every LLM inference cost calculator starts with the price of a GPU. The number that decides the answer is how busy you keep it. A rented GPU costs the same whether it is generating tokens or sitting idle, so the same eight-GPU replica that costs $1.49 per million tokens at 70% utilization costs $10.42 at 10%. One department's assistant, used during business hours and idle nights and weekends, lives at the expensive end.

At current market prices the bar is higher than most teams expect. An H100 rents for a median of about $3.25 an hour. Serving Llama 3.3 70B at a fast interactive pace, one H100 produces about 1,171 tokens a second in SemiAnalysis's InferenceMAX benchmark. With a 25% allowance for the people and tooling that keep it running, that works out to $0.96 per million tokens if the GPU is busy every hour of every day. Together AI sells the same model for $1.04 per million tokens and AWS Bedrock for $0.72. Self-hosting beats Together only above 92.7% utilization and never beats Bedrock.

Real fleets are nowhere near that. Cast AI's 2026 report, based on telemetry from tens of thousands of Kubernetes clusters, puts average GPU utilization at about 5%. At 5%, the same H100 costs $19.27 per million tokens.

This piece gives the two formulas, Python that runs as written, a table of 2026 prices, the cases where self-hosting still wins, and what falling API prices do to a three-year hardware bet. Every number can be reproduced in the free inference cost calculator, which runs in your browser.

Self-Hosted GPUs or an API? LLM Inference Cost per Million Tokens · 1 min 11 s
Video transcript

Self-hosted GPUs or an API? The same eight-GPU replica costs $10.42 per million tokens at 10% utilization and $1.49 at 70%, seven times the cost. A rented GPU costs the same busy or idle, so utilization, not the GPU price, decides the cost per token.

Two formulas. Cost per million tokens is the GPU price per hour, times the GPUs, times one plus overhead, divided by tokens per second times 3,600 times utilization. The GPU price, throughput and overhead are fixed by the market; utilization is set by how you use it; break-even utilization is where self-hosting matches the API price. Going from 5% to 35% utilization saves $17.85 per million tokens; 70% to 100% saves $0.45.

At 2026 market prices, a rented H100 at the $3.25 median costs $0.96 per million tokens at full load. Together AI sells Llama 3.3 70B for $1.04 and AWS Bedrock for $0.72. One H100 serves 1,171 tokens a second at a fast chat pace, so self-hosting beats Together only above 92.7% utilization and never beats Bedrock.

Most GPUs sit idle. Cast AI telemetry from tens of thousands of clusters puts average GPU utilization near 5%, where an H100 costs $19.27 per million tokens. An optimized fleet at 50% costs $1.93, against an API price of $1.04.

Self-hosting still wins with owned hardware, custom models or a shared pool. A rented H100 needs 92.7% utilization to match a $1.04 API; an owned H100 at $1.18 an hour over three years needs 33.6%. Data that can't leave, a fine-tuned model, or a Kansas City pool whose members peak at different times can all change the answer.

API prices keep falling; your GPU's cost doesn't. The owned H100 breaks even at 33.6% today and would need 67.3% if the API price halves. Epoch AI found the price of a fixed level of capability fell 9 to 900 times a year.

Find your break-even before the next GPU contract at vector1.ai/demos/inference-cost. It is free, runs in your browser, and takes your GPU price, throughput and utilization. The full article and Python are on vector1.ai.

Two formulas: cost per million tokens and break-even

A replica's hourly cost is the GPU price times the number of GPUs, plus an overhead share o for operations: the engineers, monitoring, storage and networking that finance teams forget. Divide by the tokens it produces in an hour of useful work:

c = (p × g × (1 + o)) / (T × 3600 × u) × 10⁶

p is the price per GPU-hour, g the GPUs in one replica, T the replica's output tokens per second when fully batched, and u the utilization, the share of hours doing useful work. Setting c equal to an API price a and solving for u gives the utilization where self-hosting breaks even:

u^* = (p × g × (1 + o)) / (T × 3600 × a / 10⁶)

When u* is above 1, self-hosting cannot match the API even at full load. Every input but u is a property of the hardware and the market. Utilization is a property of how your organization uses the model, which is why it is the one to estimate first.

Run it: the calculator in Python

This is the model the demo runs. The defaults (an 8-GPU replica at $4.50 per GPU-hour, 12,000 tokens a second, 25% overhead, a $2.00 API price) are the illustrative assumptions I used in The Future of AI in Kansas City; the next section replaces them with 2026 market prices.

"""Self-hosted LLM inference cost per million tokens versus an API price.
The model behind vector1.ai/demos/inference-cost. Brian Curry | Vector1 Research."""
from dataclasses import dataclass
import math

HOURS_PER_MONTH = 730


@dataclass
class Deployment:
    gpu_hour_usd: float        # rented, or amortized purchase, cost per GPU-hour
    gpus: int                  # GPUs serving one model replica
    tokens_per_sec: float      # aggregate output tokens per second for the replica, fully batched
    utilization: float         # share of hours the replica does useful work
    ops_overhead: float = 0.25 # people, monitoring, storage, networking, as a share of GPU spend

    def hourly(self) -> float:
        return self.gpu_hour_usd * self.gpus * (1 + self.ops_overhead)

    def cost_per_million(self, utilization: float | None = None) -> float:
        u = self.utilization if utilization is None else utilization
        return self.hourly() / (self.tokens_per_sec * 3600 * u) * 1e6

    def breakeven_utilization(self, api_per_million: float) -> float:
        """Utilization at which self-hosting matches the API price. Above 1.0 means never."""
        return self.hourly() / (self.tokens_per_sec * 3600 * api_per_million / 1e6)

    def monthly(self, billion_tokens: float, api_per_million: float):
        capacity = self.tokens_per_sec * 3600 * HOURS_PER_MONTH * self.utilization / 1e9
        replicas = max(1, math.ceil(billion_tokens / capacity))
        return replicas, replicas * self.hourly() * HOURS_PER_MONTH, billion_tokens * 1000 * api_per_million


if __name__ == "__main__":
    demo = Deployment(gpu_hour_usd=4.50, gpus=8, tokens_per_sec=12_000, utilization=0.35)
    print(f"demo default: ${demo.cost_per_million():.2f}/M at 35%, break-even vs $2.00: {demo.breakeven_utilization(2.00):.1%}")
    for u in (0.05, 0.10, 0.35, 0.70, 1.00):
        print(f"  utilization {u:.0%}: ${demo.cost_per_million(u):.2f}/M")

It prints:

demo default: $2.98/M at 35%, break-even vs $2.00: 52.1%
  utilization 5%: $20.83/M
  utilization 10%: $10.42/M
  utilization 35%: $2.98/M
  utilization 70%: $1.49/M
  utilization 100%: $1.04/M

The cost falls as 1/u, so the curve is steep at the low end and flat at the top. Going from 5% to 35% utilization cuts the cost per million by $17.85. Going from 70% to 100% saves another $0.45. The money is in getting out of the bottom of the range, not in squeezing the last points out of the top.

The monthly view adds a second trap. At 35% utilization one default replica can serve about 11 billion tokens a month. A team that needs 10 billion pays $32,850 a month for the replica against $20,000 on the API, and if its real volume is far below one replica's capacity, its real utilization is lower than the slider says.

What 2026 prices say about LLM inference cost

Swap the illustrative defaults for market numbers and look at one GPU serving Llama 3.3 70B. The throughput is SemiAnalysis's InferenceMAX figure for an H100 in FP8 at about 58 tokens a second per user, a responsive chat pace: 1,171 tokens a second per GPU. The overhead stays at 25%.

for label, price in [("Spot or marketplace floor", 2.20), ("Market median", 3.25),
                     ("AWS on-demand", 6.88), ("Owned, three-year amortization", 31_000 / (3 * 8760))]:
    gpu = Deployment(gpu_hour_usd=price, gpus=1, tokens_per_sec=1171, utilization=1.0)
    print(f"{label}: ${gpu.cost_per_million(1.0):.2f}/M at 100%, ${gpu.cost_per_million(0.5):.2f}/M at 50%, "
          f"break-even {gpu.breakeven_utilization(1.04):.1%} vs Together, {gpu.breakeven_utilization(0.72):.1%} vs Bedrock")
H100 cost per GPU-hourCost per million at 100%At 50%Break-even vs. $1.04 APIBreak-even vs. $0.72 API
$2.20, spot or marketplace floor$0.65$1.3062.7%90.6%
$3.25, market median$0.96$1.9392.7%never
$6.88, AWS on-demand$2.04$4.08nevernever
$1.18, owned over three years$0.35$0.7033.6%48.6%

For a popular open-weight model on rented GPUs, the API is the cheaper choice at almost any utilization a real team reaches. Providers serving thousands of customers run their hardware near full load around the clock, which is exactly the variable a single company struggles to control. Rented self-hosting only pays on the cheapest marketplace capacity, which is often interruptible, and only when the GPUs stay busy most of the day.

Benchmark cost figures hide the same assumption. SemiAnalysis lists about $0.28 per million tokens for the H100 at this pace, which implies every GPU-hour is sold. Divide any benchmark's cost per token by your real utilization before comparing it to an API price.

Utilization is the number most teams never measure

The 5% figure is an average across clusters before any optimization; Cast AI reports that optimized environments reach about 50%. Even 50% is far below the 92.7% a median-priced H100 needs to match a $1.04 API.

Low utilization has ordinary causes. A model sized for peak traffic sits mostly idle off-peak. Replicas kept warm for latency serve a trickle overnight. Separate teams each run their own replica of the same model. Development and evaluation capacity runs at a fraction of production load. None of these show up in a GPU price quote, and all of them show up in the cost per token.

Measure it the way the formula uses it: tokens actually generated in a month divided by what the replica could generate if fully batched every hour. If that number is unknown, the honest assumption is low.

When self-hosting still wins

Price per token is one input to the decision, and often not the deciding one.

Owned hardware changes the math. A new H100 sells for about $31,000. Spread over three years, that is $1.18 an hour before power, hosting and space, which this calculation leaves out. At that cost, self-hosting matches a $1.04 API at 33.6% utilization and a $0.72 API at 48.6%. A team with steady, predictable load and somewhere to put the hardware can come out ahead, provided the hardware is still useful in year three.

Some workloads have no API to compare against: a fine-tuned or custom model, a model with data that cannot leave a controlled environment under HIPAA or a client contract, or a latency guarantee a shared endpoint will not give. For those, the calculator answers a different question, what the control costs per million tokens, which is worth knowing before the budget meeting.

Pooling is the third route, and it is a Kansas City opportunity. A single hospital, insurer or bank rarely keeps a GPU busy. A shared pool whose members peak at different times (tax season for one, open enrollment for another, overnight batch work for a third) can run the same hardware at the utilization that makes self-hosting pay, while each member keeps its data controls. I will work through the economics of that pool on December 21.

What falling AI prices do to a three-year GPU bet

Buying hardware is a bet on prices, and the trend runs one way. Epoch AI found that the price to reach a fixed level of model performance fell between 9 times and 900 times per year over three years, depending on the benchmark. Those figures track the frontier of capability rather than one fixed open model, but the direction holds across both.

That asymmetry matters for any build-versus-buy decision made on today's prices. A GPU bought this year carries a fixed cost for three years. The API price for the capability it delivers keeps falling as models get cheaper to run and as capability moves down the cost curve. If the API price for this workload fell by even half, the owned H100 above would need 67.3% utilization instead of 33.6% to break even. The tighter your utilization margin today, the faster a falling API price erases it, so leave room for prices to fall when you size a purchase.

Where it breaks

The model counts generated tokens only. Long prompts cost GPU time too, and most APIs price input and output tokens separately; Together and Bedrock happen to price Llama 3.3 70B at one flat rate, which keeps this comparison clean. For a workload dominated by long prompts and short answers, measure throughput on your own mix.

Throughput depends on the model, precision, batch size, prompt length and how fast each user needs tokens. At a slower 38 tokens a second per user, SemiAnalysis measured 1,848 tokens a second per H100, which brings the median-priced break-even against $1.04 down to 58.7%. Benchmarks are a starting point, not a substitute for a test on your own serving stack.

GPU prices are volatile, and the median here comes from September and October 2026 indexes. The 25% overhead is an assumption, and teams without a platform group may find it low. Model quality, safety review and support also differ between a hosted endpoint and your own deployment, and none of that is in a cost per token.

Run your own numbers before the next GPU contract

Start with utilization: pull last month's generated tokens and divide by what your replicas could have produced. Then open the inference cost calculator, enter your GPU price, replica size and measured throughput, set utilization to the number you measured, and set the API price to a quote for the same model. If the break-even sits above your measured utilization, the API is cheaper today, and the question becomes whether control, latency or a custom model is worth the difference.

If you run a Kansas City organization with GPUs that sit idle part of the week, I would like to hear what your utilization looks like; it is the input to the shared pool analysis.

Sources

Related research