Home › Blog › Self-Hosting an LLM vs Using an API: Breakeven Explained

Infrastructure

Self-Hosting an LLM vs Using an API: Breakeven Explained

Self-hosting looks cheap when GPUs are busy and expensive when they sit idle. The breakeven depends on utilization more than anything else.

Quick answer

Self-hosting wins only at high, steady utilization on a model that meets your quality bar, after counting engineering time.

The inputs

The formula

Cost per 1M tokens = GPU cost per hour ÷ (tokens per second × 3,600 × utilization) × 1,000,000. Compare that with the API's blended price per 1M tokens.

Why utilization dominates

At 20% utilization you pay for five times the capacity you use. APIs bill only what you use, which is why they usually win for spiky traffic.

Before you self-host

Make sure caching, batching, output limits and cheaper hosted models haven't already closed the gap. Then run the numbers in the self-host vs API calculator.

Frequently asked questions

Is self-hosting an LLM cheaper than an API?

Only at high, steady utilization with a model that meets your quality bar, after engineering time.

How do I calculate LLM self-hosting cost per token?

Divide GPU cost per hour by tokens produced per hour at your real utilization.

Want us to find your 20%?

Book a free 15-minute API cost teardown. Bring last month's provider usage and we'll show you your biggest waste and the first fix we'd ship.

Get a Free 15-Minute API Cost Teardown

Related