# Self Hosted LLM Cost per Million Tokens: The Math

Published 4 November 2026, updated 7 November 2026. 5 min read. For: Engineers and founders comparing a per-token API bill with serving an open model on their own GPU.

## Key facts

- Self-hosted LLM cost per million tokens is the GPU's hourly price divided by the millions of tokens it serves in that hour.
- If one H200 at the October 2026 median, $5.70 an hour (uvik.net GPU price index), sustains 1,000 tokens a second, its tokens cost about $1.58 per million.
- Utilization is the whole game: a GPU idle nine hours in ten makes the same tokens cost ten times as much.
- Break-even example: an H200 at $5.70 an hour, busy half the time, beats a $2.00 per million API above about 1,583 output tokens per second.
- Self-hosting wins with steady traffic and batch jobs; a few requests a day, spiky traffic or work that needs an SLA favor the API.

Self-hosted LLM cost per million tokens is your GPU's hourly price divided by the millions of tokens it serves in that hour. If one H200 at the October 2026 market median of $5.70 an hour sustains 1,000 tokens a second, its tokens cost about $1.58 per million. If it sits idle nine hours in ten, the same tokens cost ten times that.

The whole game is utilization. Here is the math, a way to measure your own inputs in an afternoon, and the line where self-hosting beats an API.

## The formula

```text
tokens per hour          = tokens per second x 3,600
cost per million tokens  = hourly price / (tokens per hour / 1,000,000)
                         = hourly price x 277.8 / tokens per second
real cost per million    = cost per million / share of paid hours the GPU is busy
```

Two rules keep the comparison honest:

- **Count the tokens your API bill counts.** Most APIs price input and output tokens differently. Compare output with output, or totals with a blended price.
- **Use throughput across all requests, not per request.** A GPU serving dozens of conversations at once produces far more tokens per second than any single conversation sees. Batching is where self-hosting earns its keep.

## A worked table

Inputs: one H200 at $5.70 per GPU-hour (uvik.net GPU price index, October 2026 median, on demand). The throughputs are example inputs, not benchmarks; your model and your settings decide yours.

| Sustained throughput | Tokens per hour | Busy 100% | Busy 50% | Busy 10% |
|---|---|---|---|---|
| 250 tokens/s | 0.9 million | $6.33 | $12.67 | $63.33 |
| 1,000 tokens/s | 3.6 million | $1.58 | $3.17 | $15.83 |
| 4,000 tokens/s | 14.4 million | $0.40 | $0.79 | $3.96 |

Compare two cells. The 4,000 tokens/s GPU that's busy one hour in ten costs $3.96 per million; a GPU a quarter as fast that never stops costs $1.58. Utilization moves the result as much as raw speed does.

## Your hourly price comes from memory

The hourly price is set by the smallest setup that holds your model. The memory figures come from our model pages; the prices are the lowest listings right now:

| Model | Precision | GPU memory | Smallest setup | Lowest price now |
|---|---|---|---|---|
| [Qwen3.8-27B](/models/qwen/qwen3.8-27b.html.md) | 4-bit | 17 GB | 1x RTX 4090 | [the live price](/gpus/rtx-4090.html.md) per GPU-hour |
| Qwen3.8-27B | 16-bit | 67 GB | 1x A100 | [the live price](/gpus/a100.html.md) per GPU-hour |
| [gpt-oss-120b](/models/openai/gpt-oss-120b.html.md) | 8-bit | 140 GB | 1x H200 | [the live price](/gpus/h200.html.md) per GPU-hour |
| [GLM-5.3](/models/zai-org/glm-5.3.html.md) | 8-bit | 904 GB | 4x B300 | [the live price](/gpus/b300.html.md) per GPU-hour, times four |

Lower precision means a cheaper GPU, but check quality on your own prompts before you commit to 4-bit. The rules behind the memory numbers are in [the GPU memory guide](/guides/gpu-memory.html.md), and the Qwen model is covered in depth in [Qwen3.8-27B GPU requirements](/blog/qwen-3-8-27b-gpu-requirements.html.md).

## Measure your throughput in an afternoon

[Deploy the model](/deploy.html.md) on the GPU you picked, then replay prompts that look like your traffic at the concurrency you expect. The endpoint speaks the OpenAI API and reports token counts in every answer's `usage`, so counting is easy:

```python
import asyncio, time
from openai import AsyncOpenAI

client = AsyncOpenAI(base_url="http://<your endpoint>/v1", api_key="sk-...")
PROMPTS = ["Summarize this support ticket: ...", "Draft a reply to: ..."]  # use real ones

async def one(prompt):
    r = await client.chat.completions.create(
        model="Qwen/Qwen3.8-27B",
        messages=[{"role": "user", "content": prompt}],
        max_tokens=400,
    )
    return r.usage.completion_tokens

async def main(concurrency=32, rounds=5):
    start, total = time.time(), 0
    for i in range(rounds):
        batch = [PROMPTS[(i + j) % len(PROMPTS)] for j in range(concurrency)]
        total += sum(await asyncio.gather(*(one(p) for p in batch)))
    seconds = time.time() - start
    print(f"{total} output tokens in {seconds:.0f} s = {total / seconds:.0f} tokens/s")

asyncio.run(main())
```

Raise the concurrency until latency gets worse than your product allows; the throughput at that point is your number. The free plan call, `POST /v1/deploy/plan`, also gives a rough speed for one request on each GPU the model fits on. Use it to shortlist GPUs, then measure the batched number yourself.

## A batch job, start to finish

Batch work is where the formula is easiest to trust, because you set the concurrency and the queue never runs dry. Example inputs: one million support tickets to summarize at about 300 output tokens each, so 300 million output tokens. Say your load test showed one H200 sustaining 2,000 output tokens a second at full concurrency. That's 7.2 million tokens an hour, so the job takes about 41.7 hours, which bills as 42 started hours. At the $5.70 October median that's $239.40, about $0.80 per million output tokens, with the GPU busy for almost every minute you paid for. Stop the machine when the queue empties and the bill stops with it.

## Costs the formula leaves out

- **Start-up minutes.** After the machine starts, the engine downloads and loads the model before it answers, usually a few minutes. Keep a server up for long stretches rather than restarting it per job.
- **Rounding.** Each started hour counts in full, so a 61-minute job pays for two hours.
- **Storage.** Datasets and outputs kept on a volume are billed per GB-month of data held.
- **Attention.** An endpoint you run is an endpoint you watch. Set a removal time so a forgotten one stops by itself.

## When self-hosting wins

- **Steady traffic.** The machine costs its hourly price however many requests it serves, so a GPU that stays busy pushes the cost per token down every hour.
- **Batch jobs.** Summarize a million documents at full concurrency, then stop the machine. You pay for hours, not tokens.
- **Models no API serves.** Your own fine-tune, a fresh open release, or an exact version you need to pin. Big ones too: [GLM-5.3](/blog/run-glm-5-3.html.md) in 8-bit fits on four B300s.
- **Your own engine options.** You choose the engine and its flags, from context length to prefix caching.

Self-hosting doesn't mean owning, and in 2026 owning means a big check up front. New 8-GPU B300 nodes were appraised at $400,000 to $520,000 in October 2026 (amcompute.com). At a hypothetical $50 an hour for that machine, $400,000 pays for 8,000 hours of it, about 11 months round the clock. An owned GPU counts every hour of its life as a paid hour, so the busy share in the formula is set by your traffic alone. Rented, you stop the machine when the work stops and the paid hours stop with it. Full math: [rent vs buy GPUs in 2026](/blog/rent-vs-buy-gpu-2026.html.md).

## When the API wins

- **A few requests a day.** Each started hour is charged in full. A GPU that answers ten requests an hour is mostly idle time you paid for.
- **Spiky traffic with long quiet stretches.** Per-token billing scales to zero; a rented GPU doesn't.
- **Work that needs an SLA.** Arrakis has none during early access.

## The break-even in one line

Self-hosting wins when the throughput you sustain beats this:

```text
break-even tokens per second = hourly price x 277.8 / (API price per million x busy share)
```

Example inputs: an H200 at $5.70 an hour, busy half the time, against an API that charges $2.00 per million output tokens. 5.70 x 277.8 / (2.00 x 0.5) is about 1,583 output tokens per second. Sustain more than that across your traffic and your own GPU is cheaper; sustain less and the API is. Put your real API price and your measured throughput in, and you have your answer.

## Run the numbers on a real GPU

Deploy your model, load-test it for an hour, and decide with your own data instead of someone else's benchmark. Start on [the deploy page](/deploy.html.md) or rent a GPU from [the console](/console/).

New here? Use code [FIRST25](/console/?code=FIRST25) for $25 off your first deposit of $50 or more, until 31 December 2026.

## Rent the GPUs in this post

- [H200](/gpus/h200.html.md): [the live price](/gpus/h200.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=H200) or with the MCP tool rent_gpu.
- [A100](/gpus/a100.html.md): [the live price](/gpus/a100.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=A100) or with the MCP tool rent_gpu.
- [RTX 4090](/gpus/rtx-4090.html.md): [the live price](/gpus/rtx-4090.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=RTX 4090) or with the MCP tool rent_gpu.
- [B300](/gpus/b300.html.md): [the live price](/gpus/b300.html.md) per GPU-hour now; rent in the console (/console/#/gpus?gpu_type=B300) or with the MCP tool rent_gpu.

## Questions

**How do I calculate self-hosted LLM cost per million tokens?** Divide the GPU's hourly price by the millions of tokens it serves in an hour, which is tokens per second times 3,600, divided by 1,000,000. Then divide by the share of paid hours the GPU is actually busy.

**When is self-hosting an LLM cheaper than an API?** When the GPU stays busy. A machine costs its hourly price whether it serves one request or thousands, so steady traffic and large batch jobs favor your own GPU, and a few requests a day favor paying per token.

**What throughput should I assume for my model?** None: measure it. Deploy the model, replay real prompts at the concurrency you expect, and count the tokens the endpoint reports. The model, engine options, prompt lengths and batch size all move the number.

**Does idle time count in the cost per token?** Yes. You pay for every started hour the machine runs, busy or not, so a GPU that is busy half the time doubles your cost per million tokens.

## More from the blog

- [How Much GPU Memory Do I Need? The Plain-English Answer](/blog/how-much-gpu-memory-beginners.html.md): How much GPU memory do I need? Multiply the model's billions of parameters by 2.4, 1.2 or 0.6 GB, then rent the cheapest GPU that holds the result.
- [Fine-Tune Qwen with LoRA: Cost, Memory and Hours](/blog/fine-tune-qwen-lora-cost.html.md): What it costs to fine tune Qwen with LoRA or QLoRA: the memory per model, the GPU that holds it, a worked estimate of hours, and the dollars per run.
- [Open Source LLM on a Single GPU: 13 Models That Fit](/blog/open-models-one-gpu-2026.html.md): Which open source LLM runs on a single GPU? 13 of the 16 open models we track fit one card at 16, 8 or 4-bit, from an RTX 4090 to a B300. The full list.

Every post: [/blog](/blog.html.md). RSS: [/blog/feed.xml](/blog/feed.xml).
