Blog / cost per token

How to calculate cost per million tokens on your GPUs

Divide what a GPU-hour costs you by the tokens it serves in that hour. The formula, the inputs that change it and a worked DeepSeek example.

Formula for cost per million tokens on your own GPUs

Cost per million tokens on your own GPUs is what one GPU-hour costs you, divided by the millions of tokens that GPU serves in an hour. For example, a GPU that costs $1.73 an hour and serves 2.46 million output tokens costs $0.70 per million output tokens. The hard part is measuring tokens per hour on your real traffic and counting input tokens fairly.

The formula

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

Then divide by your load:

real cost per 1M tokens = cost per 1M tokens ÷ average load

A GPU that is busy half the time costs twice as much per token as one that is always busy.

That's all the maths. Everything else in this post is about getting the three inputs right: cost per hour, tokens per second and load.

Input 1: what a GPU-hour costs you

Use the number that matches how you pay:

  • Rented on demand: the hourly price. The median in October 2026 was $4.20 for an H100, $5.70 for an H200, $8.19 for a B200 and $9.50 for a B300 (Uvik GPU price index).
  • Reserved: the reserved rate. Together AI, for example, lists H200s at $4.15 an hour on 31 to 90 day reservations against $5.99 on demand (pricing).
  • Owned: depreciation plus power, cooling, space and network, divided by hours. SemiAnalysis estimates hyperscale ownership at $1.17 per H100-hour and $2.26 per B300-hour (InferenceX, H100 vs B300), and $1.22 per H200-hour and $1.73 per B200-hour (InferenceX, H200 vs B200), from its July 2026 pricing survey. Smaller buyers usually pay more.

If you already own GPUs that sit idle part of the day, the extra cost of serving more tokens on them is close to the power bill. That is the strongest case for serving models in-house.

Input 2: tokens per second

This is the number people get wrong most often, in three ways.

Using single-user speed. A model that streams 80 tokens per second to one user may serve thousands per second across many users. Cost depends on total throughput across all concurrent requests, not the speed one user sees.

Using output tokens only. Agents and RAG apps send long prompts and get short answers. The GPU spends real work reading the prompt, even when much of it comes from cache. Measure throughput on your real mix of prompt and answer lengths, or the number will be far too optimistic.

Using someone else's benchmark. Published numbers depend on the engine, the parallelism, speculative decoding and the prompt lengths in the test. For DeepSeek V4.1 Flash, NVIDIA's Dynamo recipe reports 315 output tokens/s per H200 at 56 concurrent requests, while SemiAnalysis InferenceX reports 231 per H200 at 32 sessions (via OpenRouter). Both are correct for their own setup.

The only throughput that matters is the one you measure on your GPUs, with your prompts.

Input 3: load

Average load is the share of each hour your GPUs spend serving at full throughput. Two things keep it below 100%:

  • Daily cycles. Traffic peaks in working hours and drops at night. You buy capacity for the peak.
  • Headroom. You keep spare capacity so latency doesn't spike when traffic jumps.

Measure it over a full week, not a busy afternoon. If your GPUs also train models or run batch jobs at night, load goes up and cost per token goes down.

A worked example: DeepSeek V4.1 Flash on one B200

These are example inputs from public sources, not a measurement of your setup:

  • GPU cost: $1.73 per hour (SemiAnalysis hyperscale ownership estimate above).
  • Throughput: 683 output and 117,225 input tokens per second per GPU, 96% of input from cache (InferenceX on 2 × B200, vLLM, FP4, 32 agent sessions, as quoted by OpenRouter).
  • Load: 100% to start.

Output tokens per hour: 683 × 3,600 = 2.46 million.

Cost per million output tokens, with the input work included: $1.73 ÷ 2.46 = $0.70.

At 50% load, it doubles to $1.41.

Comparing with an API fairly

APIs charge separately for input and output, and often less for cached input. To compare, price the same traffic both ways.

DeepSeek's pricing page lists V4.1 Flash at $0.006 per million cached input tokens, $0.30 per million uncached and $1.20 per million output tokens at peak, and half that off-peak. Peak is 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays.

The hour of B200 traffic in the example contains 422 million input tokens (117,225 × 3,600), of which 96% is cached, plus 2.46 million output tokens:

  • cached input: 405.1M × $0.006 = $2.43
  • uncached input: 16.9M × $0.30 = $5.06
  • output: 2.46M × $1.20 = $2.95
  • total at peak: $10.45, or $5.22 off-peak

With these example inputs, the owned B200 costs $1.73 for that hour: $1.73 ÷ $10.45 is 17% of the peak price and $1.73 ÷ $5.22 is 33% of the off-peak price. Change any input (your GPU cost, your measured throughput, your cache share, your load) and the answer changes, which is why it has to be measured.

Don't compare your cost per output token with an API's output price alone. That leaves out all the input tokens the API would also charge for.

A quick checklist before you trust your number

  1. Did you measure throughput on your own prompts, at the concurrency you will run?
  2. Did you count input tokens, cached and uncached?
  3. Did you use average load, not peak?
  4. Did you use what you actually pay per GPU-hour, not a list price?
  5. Does the self-hosted model answer as well as the API on your tests?

If any answer is no, your cost per token is probably too low.

Measure it on your own GPUs

dl model sets up an open model on an Nvidia GPU you own, with vLLM, and tests it before it goes live; the details are in the docs. Serving DeepSeek V4.1 Flash across several GPUs with it is coming soon. If your team runs a bigger setup, we're working with a few design partners to get them going. Tell us what you run: your company, your GPUs, and the models you use.

FAQs

What is a good cost per million tokens for DeepSeek?

It depends on your mix of input and output. Compare with what DeepSeek's API would charge for the same traffic: $0.30 per million uncached input, $0.006 cached and $1.20 output at peak, half off-peak (DeepSeek pricing). If your cost for the same tokens is lower, self-hosting is saving money.

Should I count input tokens?

Yes. Agent and RAG traffic is mostly input. The GPU spends real time reading prompts, and APIs charge for them, so a fair comparison includes them on both sides.

How does load change the cost?

Cost per token divides by average load. At 50% load each token costs twice as much as at full load. Using spare capacity at night for batch work brings it back down.

Why are published throughput numbers so different?

Each benchmark uses a different engine, parallelism, concurrency and prompt length. They are all correct for their own setup. Measure on your own GPUs with your own prompts before you decide.