Skip to content
LLM Pricing Calc
API pricing last verified GPU rental rates

LLM API vs Self-Hosting Cost Calculator

Compare per-token APIs, hosted open-weight APIs and dedicated cloud GPUs, and find the monthly token volume where self-hosting an LLM breaks even.

= 2B tokens / month

75% in

Leave at 0 to use the estimate (~534 tok/s).

API / month

$8,000

GPT-6.2 Sol

Self-host / month

$3,489

1 × 2 GPU, always on

Break-even volume

872.35M

tokens / month

Monthly cost versus monthly token volume
API modelSelf-hosted GPUHosted open-weight API
Cost comparison at your volume
OptionMonthlyPer 1M tokensNotes

Self-hosting assumes always-on rental (730 h/month), 8K context per request and FP16 KV cache. Excludes engineering, redundancy and egress.

API: Official pricing ↗ · GPU rates: Official pricing ↗

Guide

LLM API vs self-hosting: the break-even math

The question is not whether a GPU is cheaper than an API. It is whether you can keep a GPU busy enough. A per-token API bills only for what you use. A dedicated GPU bills for every hour it is switched on, busy or idle. Self-hosting wins only once your steady monthly volume is large enough to spread that fixed cost thinner than the API's per-token price.

1. Per-token APIs

Cost scales linearly with volume: monthly tokens × blended price per 1M, where the blended price weights input and output by your traffic mix. With 75% input tokens, GPT-6.2 Sol works out to about $4.00 per 1M tokens. No minimum, no idle cost, and the provider handles scaling and uptime. The LLM pricing calculator adds caching, batch and agent loops to this side of the comparison.

2. Hosted open-weight APIs

Inference providers serve open models such as Llama 3.3 70B Instruct on shared GPUs and still bill per token, here about $0.155 per 1M blended. Because they keep their GPUs saturated across thousands of customers, they are usually far cheaper than both a frontier API and a GPU you rent yourself. Compare hosted open-weight prices in the LLM API price table. For many teams, this, not self-hosting, is the real alternative to a closed API.

3. Dedicated cloud GPUs

A self-hosted deployment costs hourly rate × 730 hours × GPUs per replica × replicas per month, regardless of traffic. One NVIDIA H100 80GB at $2.39/hour is $1,745 a month. Its capacity depends on decode throughput: how many output tokens per second the GPU can generate with continuous batching in vLLM, SGLang or TGI. At full utilization, the setup above produces tokens for about $0.8555 per 1M. That is the best case. At 30% average utilization the effective price rises to $2.85 per 1M.

How to find your break-even point

Break-even is the monthly volume where the two cost lines cross: break-even tokens = GPU monthly cost ÷ API price per token. Below it, the API is cheaper; above it, the GPU is, until you exceed one replica's capacity and need another. For GPT-6.2 Sol against Llama 3.3 70B Instruct on a NVIDIA H100 80GB, the crossover is about 872.35M tokens per month. The chart above plots all three options so you can see where the lines meet.

Four inputs move the break-even point the most:

  • Utilization. Traffic that peaks in office hours and drops at night leaves rented GPUs idle. Bursty workloads favour APIs.
  • Model size and quantization. A 70B model at FP16 needs several 80 GB GPUs per replica; at 4-bit it fits on one. Size the hardware with the LLM VRAM calculator.
  • Input/output mix. Prefill (input) is several times faster than decode (output), so input-heavy workloads such as RAG and classification get more tokens per GPU-hour.
  • Which API you compare against. Against a flagship model, a GPU can pay off at hundreds of millions of tokens a month. Against a budget or hosted open-weight API, it may never pay off.

When to self-host an LLM

Price is rarely the only reason. Self-hosting makes sense when you need data to stay inside your own infrastructure, want to serve a custom fine-tune, need guaranteed capacity without rate limits, or have high, steady volume that keeps GPUs above roughly 50% utilization. Budget for at least two replicas in production, plus the engineering time for deployment, monitoring and upgrades, which this calculator leaves out. If those reasons don't apply, a per-token API, often a hosted open-weight one, is usually the cheaper and simpler choice. Voice workloads follow the same logic; see the AI voice agent cost calculator for per-minute costs.

More AI cost tools

API vs self-hosting FAQ

How do I calculate the break-even point between an LLM API and a GPU?

Divide the GPU's monthly cost by the API's blended price per token. For example, a GPU that costs $1,700 a month breaks even against a $4-per-million-token API at 425M tokens a month, provided the GPU can actually serve that many tokens. This calculator also checks GPU throughput, so it tells you when a single replica cannot keep up and you would need more GPUs.

Is it cheaper to self-host Llama 3.3 70B Instruct than to use an API?

Against a frontier API such as GPT-6.2 Sol (about $4.00 per 1M blended tokens), a dedicated NVIDIA H100 80GB running Llama 3.3 70B Instruct can win at high, steady volume. Against a hosted Llama 3.3 70B Instruct API at about $0.155 per 1M, self-hosting rarely wins on price. The deciding factors are utilization, data-privacy requirements and whether you need a custom fine-tune.

When is self-hosting an LLM cheaper than using an API?

When your volume is high and steady enough to keep a dedicated GPU busy. One always-on H100 costs about $1,700 a month. That only pays off once you would otherwise spend more than that on API tokens, typically billions of tokens per month against a mid-tier API model. Against cheap hosted open-weight APIs, self-hosting rarely wins on price alone.

Why is there sometimes no break-even point?

If the GPU can't process enough tokens in a month to beat the API's per-token price even at 100% utilization, self-hosting never becomes cheaper. This is common for small or cheap API models, and for very large open models that need several GPUs.

How is GPU throughput estimated?

Single-stream decode speed is estimated from memory bandwidth and the bytes of active weights read per token. With continuous batching (vLLM, TGI, SGLang), aggregate throughput grows roughly as concurrency0.8. Input (prefill) tokens are assumed to process ~8× faster than output tokens. You can override throughput with your own benchmark numbers.

What costs does this leave out?

Engineering time, monitoring, redundancy (you'll want at least two replicas for production), egress, storage and idle capacity at night. The API side leaves out rate-limit tiers and any negotiated discounts. Treat the break-even point as a lower bound for self-hosting.

What about hosted open-weight APIs?

Providers like DeepInfra and Together serve open models such as Llama 3.3 70B for cents per million tokens. They share GPUs across many customers, which is often the cheapest option until you need data isolation, custom fine-tunes or guaranteed capacity.