See what your AI agent really costs

Is Self-Hosting an Open-Weights LLM Cheaper Than the API? The Break-Even Math

Updated 2026-10-25. Checked against official provider docs and pricing pages on 2026-10-25.

Renting a GPU and running an open-weights model yourself sounds cheaper than paying per token. Whether it actually is depends on one number most people never measure: how many tokens per second your setup sustains on your workload, around the clock. This guide gives you the formula, real list prices for both sides, and the throughput you'd need to break even. You plug in your own benchmark result. We don't invent one.

The formula

A rented GPU costs the same per hour whether it's busy or idle. An API costs per token. So:

Self-hosted $ per 1M tokens = (GPU $/hour × 1,000,000) / (tokens per second × 3,600 × utilization)

Break-even is where that equals the API's blended price. Solving for throughput:

Break-even tokens/sec = (GPU $/hour × 1,000,000) / (3,600 × API blended $ per 1M)

Before buying GPUs, compare against the cheapest hosted LLMs for AI agents and the discount from the batch API for non-urgent jobs.

Inputs: GPU rental prices (official pages)

Retrieved 2026-10-25. List prices, before tax.

ProviderGPUPrice
Lambda, 8x instanceNVIDIA H100 SXM 80 GB$3.99 / GPU / hr
Lambda, 8x instanceNVIDIA B200 SXM6 180 GB$6.69 / GPU / hr
Lambda, 1x instanceNVIDIA H100 SXM 80 GB$4.29 / hr
Lambda, 1x instanceNVIDIA B200 SXM6 180 GB$6.99 / hr
RunPod Pods, Secure Cloud (Community Cloud)H100 SXM 80 GB$3.99 / hr ($2.69)
RunPod Pods, Secure Cloud (Community Cloud)H200 141 GB$5.29 / hr ($3.59)
RunPod Pods, Secure Cloud (Community Cloud)B200 180 GB$7.99 / hr ($5.98)
RunPod Pods, Secure Cloud (Community Cloud)L40S 48 GB$1.09 / hr ($0.79)

RunPod's on-demand prices above are Secure Cloud rates, with the cheaper Community Cloud rate in brackets. Lambda prices are per GPU-hour and rise for smaller instances (H100 SXM: $3.99 on 8x, $4.09 on 4x, $4.19 on 2x, $4.29 on 1x).

Running 24/7 (730 hours a month), one H100 SXM at $3.99 (RunPod Secure Cloud) costs $2,912.70 a month. A full 8x B200 Lambda instance ($53.52/hr) costs $39,069.60 a month.

Inputs: API prices for open-weights models (models.json)

The fair comparison is to the same open-weights model served by its maker's API, not a closed frontier model. From TokenTab's models.json (lastUpdated 2026-10-25), per 1M tokens:

Model (open weights)InputOutputCached input
DeepSeek V4 Pro (peak)$1.32$3.96$0.044
DeepSeek Flash (peak)$0.30$1.20$0.006
Mistral Small 4$0.15$0.60$0.015

DeepSeek's off-peak prices are half of peak ($0.66/$1.98 and $0.15/$0.60).

Worked break-even numbers

Assumption (labeled, not measured): an input-heavy agent mix of 3 input tokens to 1 output token, no cache hits. Blended price = (3 × input + output) ÷ 4.

Compare againstBlended $/1MBreak-even on 1x H100 SXM ($3.99/hr, RunPod Secure)Break-even on Lambda 8x B200 ($53.52/hr)
DeepSeek V4 Pro (peak)$1.98~560 tok/s sustained~7,508 tok/s
DeepSeek Flash (peak)$0.525~2,111 tok/s~28,317 tok/s
Mistral Small 4$0.2625~4,222 tok/s~56,635 tok/s

The same thresholds as monthly volume at 100% utilization: an H100 has to serve about 1.47B tokens a month to match DeepSeek V4 Pro's API, 5.5B to match DeepSeek Flash, and 11.1B to match Mistral Small 4. At 33% utilization, the throughput you need while the GPU is busy roughly triples.

This table doesn't tell you whether a model fits on that hardware or how fast it actually runs. Those depend on parameter count, quantization, context length, batch size, and the serving engine. Measure them with a benchmark such as vLLM's benchmark suites on your real prompts. Then compare your measured tok/s to the break-even column.

Why the API usually wins for agents

  1. Prompt caching tilts the math further toward the API. Agent prompts repeat. Cached input on DeepSeek Flash is $0.006/M, which is 2% of its normal input price. A self-hosted engine can reuse prefixes too, but that only saves GPU time you're already paying for. Recompute the blended price with your real cache-hit rate and the break-even throughput goes up.
  2. Agents are bursty. Traffic arrives in spikes, and you size the GPU for the peak but pay for it at the trough. Utilization is the term that usually ruins self-hosting spreadsheets.
  3. Off-peak prices. DeepSeek's off-peak discount halves the API price, which doubles the break-even throughput.
  4. Costs that aren't GPU hours. Engineering time, monitoring, storage, egress, redundancy, and on-call aren't in the formula. Add them as a monthly dollar figure on the GPU side.

When self-hosting can win

How to decide in 15 minutes

  1. Estimate your monthly tokens and input/output mix. The TokenTab AI agent cost calculator gives you the API-side monthly cost per model.
  2. Compute the break-even tok/s for your GPU price with the formula above.
  3. Benchmark the model on that GPU with your real prompts.
  4. Pick self-hosting only if measured throughput × realistic utilization clearly beats break-even after adding non-GPU costs.

Sources

Retrieved 2026-10-25.

Get the TokenTab newsletter

Model price changes and agent cost tips, straight to your inbox. Unsubscribe anytime; we only use your email for this newsletter.