All insights

Provider Selection

How to Calculate the True Cost of an Open-Source Model API: From List Price to Cost per Successful Response

Price per million tokens is a useful input to a cost model. It is not the final cost of using an API.

A production application pays for a workload, not an isolated token. Inputs and outputs have different lengths. Some requests fail. Some completed responses do not pass validation. Retries and fallback calls add more tokens. Provider capacity can create operational costs that never appear on the pricing page.

For DeepSeek—or any other open-source or open-weight model—the most useful unit is cost per successful, valid result.

1. Calculate the Direct Cost of the Real Request Distribution

Begin with the provider's input and output prices, then apply them to observed usage:

request cost = input tokens × input price + output tokens × output price

Use the appropriate per-token conversion when prices are quoted per million tokens. If cached input has a different price, separate cache hits and misses rather than applying one optimistic rate to every request.

Averages alone can be misleading. Input and output lengths often have long tails, so estimate cost at several percentiles. A customer-support application may usually send a short conversation but occasionally include a long history. An agent may produce short tool calls and then one large final answer.

Separate workload classes as well. DeepSeek chat, extraction, code generation, and document analysis may use the same endpoint but have very different token distributions. A blended average can hide which feature is driving spend.

Finally, include application-generated overhead: system prompts, tool definitions, output schemas, repeated context, and retrieved documents. These tokens are part of the request even when the user never sees them.

2. Add Failures, Retries, and Invalid Outputs

The direct request cost becomes useful only when connected to an outcome. Define three counts:

  • Requests attempted
  • Responses completed successfully
  • Completed responses that pass task validation

Then calculate:

effective cost per valid result = total billed API spend ÷ valid results

Suppose a workload attempts 10,000 DeepSeek requests. If 9,500 complete and 9,000 pass validation, cost per valid result is total spend divided by 9,000—not 10,000. If failed or invalid calls are retried, include the retry spend in the numerator.

Fallback routing should be included too. A low-cost endpoint may look attractive until 10% of requests require a second call to a more expensive model. The correct comparison is the complete route needed to deliver the accepted result.

Billing rules can change the calculation. Providers may handle timeouts, interrupted streams, and requests rejected before inference differently. Request-level usage, status, cost, and identifiers make reconciliation possible. Without them, estimates must rely on client-side token counting and may not match the invoice.

Operational cost also matters. If a provider cannot sustain the required traffic, the application may need additional queues, fallback providers, monitoring, and support work. These are not token charges, but they belong in a total-cost decision.

3. Compare Cost at a Verified Capacity Level

Token Forge Cloud offers publicly listed pricing up to 60% below official list pricing. The discount is most meaningful when considered together with measured capacity and completed requests.

Its DeepSeek load test used approximately 100 input tokens, about 140 output tokens, unique prompts, fixed pacing, and reasoning disabled:

Model Stable tested load Success rate Sustained token throughput TTFT p95
deepseek-v4.1-flash 5,000 RPM 100% >1.21M TPM 1.97 s
deepseek-v4-pro 2,500 RPM 100% >617K TPM 2.82 s
kimi-k3 5,000 RPM 100% ~5M TPM 1.26 s
glm-5.3 4,200 RPM 99.95% ~5.4M TPM 5.62 s
glm-5.3-flash 2,400 RPM 100% ~3.0M TPM 5.29 s

The Kimi K3 and GLM rows come from separate tests, the Kimi K3 load test report and the GLM load test report: about 1,000 input and up to 300 output tokens per request, Kimi K3 with reasoning off, and GLM at low reasoning (it cannot be turned off). GLM is held to a TTFT p95 of 8 seconds rather than 5.

At these tested levels, all requests completed, so the observed operational success rate did not introduce retry amplification. That does not establish task-level validity; buyers should still run their own quality evaluation and include rejected outputs in the effective-cost calculation.

A useful comparison spreadsheet should contain, for each workload class: input and output token percentiles, price by token type, cache hit rate, completion rate, validation pass rate, average attempts per accepted result, fallback frequency, and required stable capacity. The result should be expressed as cost per accepted chat turn, extracted document, passing code task, or completed agent run.

List price answers, “How much does a token cost?” Production economics asks, “How much do we spend before the application obtains a result it can use?” The second question is the one that belongs in a provider decision.

Read the full Token Forge Cloud DeepSeek load test report.

Contact us