Skip to content
,

LLM Cost Per Token: How Much Does It Really Cost to Run an AI Model?

What does it cost to generate a million tokens with an LLM? A practical guide to inference economics: the cost-per-token formula, how GPU price, throughput, batching, model size and quantization change it, worked examples with today's H100, H200 and B200 rental prices, API vs self-hosting, and the biggest levers for cutting cost.

5 min read

LLM Cost Per Token — llm cost per token

Short answer

LLM cost per token comes down to one formula: GPU cost per hour ÷ tokens generated per hour. A GPU renting for $3.92/hour (the median H100 price on our tracker) that serves 1,500 tokens per second across many users costs about $0.73 per million output tokens; the same GPU serving a single user at 50 tokens per second costs about $22 per million. The biggest levers are batching (utilisation), model size, quantization and hardware choice. APIs are usually cheaper for small or bursty workloads; self-hosting can win at high, steady volume or when privacy requires it.

The core formula

cost per 1M tokens = GPU cost per hour ÷ (tokens per second × 3,600) × 1,000,000

Two numbers drive everything:

1. What you pay per GPU-hour (cloud price, or amortised hardware plus power). 2. How many tokens that GPU produces per hour, which depends on model size, hardware, software and how many requests you batch together.

Today's GPU prices (inputs to the formula)

From the TensorCore.si GPU cloud price tracker on November 27, 2026 (on-demand, per GPU-hour):

GPULowestMedian
A100 80 GB$0.89$2.19
H100 80 GB$1.80$3.92
H200 141 GB$2.09$4.95
B200 180 GB$4.11$8.10
RTX 4090 24 GB (marketplaces)~$0.26~$0.48 typical

Why throughput varies so much

FactorEffect on tokens per second
Batching / concurrencyThe biggest factor: serving many users at once multiplies total throughput because each read of the weights serves many tokens
Model sizeBigger models read more bytes per token, so they are slower
Quantization (FP8, FP4, INT4)Fewer bytes per weight means faster decoding and more room for batches
Memory bandwidthSets single-user speed; see GPU memory bandwidth
Compute (tensor cores)Sets batched throughput and prompt processing
Context lengthLonger contexts mean bigger KV caches and fewer concurrent users; see KV cache
Inference enginevLLM, SGLang and TensorRT-LLM add continuous batching and paged KV cache; see inference engines compared
Speculative decoding2–3× faster single-stream generation; see speculative decoding

Worked examples

All examples use output tokens and assume costs at median rental prices. Real throughput depends on model, engine and settings.

ScenarioGPU and priceAssumed throughputCost per 1M tokens
Single user chatting with a 70B model (FP8)1 × H100 at $3.92/hr50 tok/s~$21.80
Same model, well-batched serving1 × H100 at $3.92/hr1,500 tok/s total~$0.73
8B model, batched1 × H100 at $3.92/hr5,000 tok/s total~$0.22
8B model, cheap marketplace GPU, batched1 × RTX 4090 at $0.48/hr1,500 tok/s total~$0.09
Large MoE model across 8 GPUs, batched8 × H200 at $4.95/hr ($39.60/hr)8,000 tok/s total~$1.38
FP4 serving on Blackwell1 × B200 at $8.10/hr6,000 tok/s total~$0.38

The lesson: utilisation matters more than almost anything else. An idle or lightly used GPU is expensive per token; a well-batched one is cheap.

Input vs output tokens

APIs usually charge less for input tokens than output tokens, because:

  • Input (prefill) is processed in parallel and uses the GPU efficiently.
  • Output (decode) is generated one token at a time and is memory-bound.

Prompt caching can reduce input costs further when the same long system prompt or documents are reused. See prefill vs decode and What are tokens in AI?.

Reasoning models change the maths

Reasoning models generate many hidden "thinking" tokens before answering. A question that needs 500 visible tokens might generate 5,000 or more in total, multiplying cost per answer. Measure cost per task, not just cost per token.

API vs self-hosting

API (pay per token)Self-hosting (rent or own GPUs)
Upfront effortMinimalSetup, monitoring, scaling
Cost at low volumeUsually cheaperExpensive (idle GPUs)
Cost at high, steady volumeCan be higherCan be much cheaper with good utilisation
Model choiceProvider's modelsAny open model
Privacy and controlData sent to providerData stays in your environment
Latency controlLimitedFull

Break-even rule of thumb: self-hosting makes sense when you can keep GPUs busy most of the time. Calculate your expected tokens per month, the equivalent API cost, and compare with GPU-hours needed at realistic utilisation.

Owning hardware: cost per token at home

For a purchased GPU, include amortised hardware and electricity:

hourly cost = (hardware price ÷ expected hours of use) + (watts ÷ 1,000 × electricity price)

Example: a $2,000 GPU used 4,000 hours over its life is $0.50/hour, plus about $0.07/hour of electricity at 450 W and $0.15/kWh. See GPU power consumption for AI and rent vs buy a GPU.

The biggest levers to cut cost

1. Batch requests with an engine that supports continuous batching. 2. Use the smallest model that meets quality needs; see small language models. 3. Quantize to FP8, FP4 or 4-bit where quality allows; see LLM quantization. 4. Use prefix caching for repeated prompts and documents. 5. Choose the right GPU: cheapest per token, not cheapest per hour; see H200 vs B200. 6. Use spot or reserved capacity for predictable workloads; see cloud GPU providers compared. 7. Limit output length and reasoning effort when not needed. 8. Route requests: send easy tasks to small models and hard ones to large models.

Frequently asked questions

How much does it cost to run ChatGPT-like models?

It depends on model size and scale. Large providers serve enormous volumes with heavy batching and custom optimisation, achieving far lower cost per token than a single small deployment.

Is it cheaper to run an LLM locally?

For light personal use, local inference on a GPU you already own costs mainly electricity. For high-quality large models or many users, cloud GPUs or APIs are often more practical.

What is a good cost per million tokens?

It varies widely by model quality, from a few cents for small models to tens of dollars for the most capable reasoning models. Compare cost per completed task rather than raw token prices.

Why is batching so important?

Because generating a token requires reading all model weights from memory. Serving many users at once shares that cost across many tokens.

Sources and further reading

Think you understand it now? Prove it.

Solve real Tensor Core math in the TensorCore.si Challenge and earn a certificate with your name.

Take the challenge

Leave a Reply

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