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,000Two 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):
| GPU | Lowest | Median |
|---|---|---|
| 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
| Factor | Effect on tokens per second |
|---|---|
| Batching / concurrency | The biggest factor: serving many users at once multiplies total throughput because each read of the weights serves many tokens |
| Model size | Bigger 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 bandwidth | Sets single-user speed; see GPU memory bandwidth |
| Compute (tensor cores) | Sets batched throughput and prompt processing |
| Context length | Longer contexts mean bigger KV caches and fewer concurrent users; see KV cache |
| Inference engine | vLLM, SGLang and TensorRT-LLM add continuous batching and paged KV cache; see inference engines compared |
| Speculative decoding | 2–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.
| Scenario | GPU and price | Assumed throughput | Cost per 1M tokens |
|---|---|---|---|
| Single user chatting with a 70B model (FP8) | 1 × H100 at $3.92/hr | 50 tok/s | ~$21.80 |
| Same model, well-batched serving | 1 × H100 at $3.92/hr | 1,500 tok/s total | ~$0.73 |
| 8B model, batched | 1 × H100 at $3.92/hr | 5,000 tok/s total | ~$0.22 |
| 8B model, cheap marketplace GPU, batched | 1 × RTX 4090 at $0.48/hr | 1,500 tok/s total | ~$0.09 |
| Large MoE model across 8 GPUs, batched | 8 × H200 at $4.95/hr ($39.60/hr) | 8,000 tok/s total | ~$1.38 |
| FP4 serving on Blackwell | 1 × B200 at $8.10/hr | 6,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 effort | Minimal | Setup, monitoring, scaling |
| Cost at low volume | Usually cheaper | Expensive (idle GPUs) |
| Cost at high, steady volume | Can be higher | Can be much cheaper with good utilisation |
| Model choice | Provider's models | Any open model |
| Privacy and control | Data sent to provider | Data stays in your environment |
| Latency control | Limited | Full |
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
- TensorCore.si, GPU cloud price tracker (data as of November 27, 2026)
- Kwon et al., Efficient Memory Management for Large Language Model Serving with PagedAttention (2023)
- Databricks, LLM inference performance engineering: best practices (2023)
- Pope et al., Efficiently Scaling Transformer Inference (2022)




Leave a Reply