ChatGPTClaudeGrok / X / CursorGemini

DeepSeek Harness Token Counts vs Billing: Why They Differ

TroubleshootingPublished 2026-11-18Author: DeepSeek Plugin Market
DeepSeek HarnessDSH plugintoken meterbillingcompaction
DeepSeek Harness page tokens, session totals, and provider billing can differ. Separate them and account for cache, reasoning, retries, and compaction.

“The page says 10k tokens, the bill says 14k” is not automatically a broken meter. The page usually shows session metering and context projection; the bill comes from provider billing. Cache hits, reasoning tokens, retries, and compaction all create differences (source). Reconciliation explains the gap; it does not force two numbers to match.

DeepSeek Harness: Three metering points

There are at least three token numbers: before the request, after the response, and cumulative for the session. They answer different questions. (source)

PointWhenQuestion
Pre-request estimateDuring request assemblyHow large is this request, will it fit?
Post-response actualAfter the responseHow much input/output did this use?
Session totalAfter each requestHow much has this session used?

The estimate drives decisions: compact, truncate, or proceed. It is not the bill.

The actual is closer to billing but still affected by cache, reasoning, and provider rules. It answers “what happened in this request.”

The session total is a process record, not a bill. It includes retries, failed attempts, and pre-compaction requests; billing may merge or discount them.

Confirm which number you are reading. Treating the estimate as a bill overstates; treating the total as current context understates.

DeepSeek Harness: Cache hits and reasoning tokens

Cache hits and reasoning tokens are the two most common gaps. They do not always appear in the same total. (source)

  • Cache hits — the provider reuses a previously computed segment, often at lower cost; the exact visible context may differ by implementation.
  • Reasoning tokens — a reasoning model may generate hidden thinking tokens, metered and billed separately; a page that shows only visible output looks smaller than the bill.

Check the detail for cache and reasoning fields rather than the total. If detail is unavailable, suspect these two before suspecting the meter.

A third gap is retries. A failed attempt may consume tokens, and the retry consumes more; the session total records both, and billing may charge both while the page shows only the final output.

DeepSeek Harness: Session total vs bill

The session total records what happened; the bill records what was charged. Different goals, expected gaps. (source)

The session total usually includes:

  1. Failed attempts — the request was sent and failed, possibly billed.
  2. Retries — the same task requested multiple times.
  3. Pre-compaction requests — context shrank later, but earlier requests already happened.
  4. Tool calls — tool results enter context and enlarge later requests.

The bill may apply cache discounts, batching, or plan rules, so it will not map one-to-one. Use the session total to explain the bill, not to demand equality.

If the gap grows steadily, look for retry loops, oversized tool results, or frequent compaction. All three make token use nonlinear.

DeepSeek Harness: Why three numbers differ

Different scopes, not a bug. Three patterns (source):

SymptomLikely causeCheck
Page lower than billCache/reasoning not shown, retries not countedMeter detail, retry records
Page higher than billSession total includes failed attempts and pre-compaction requestsFailed attempts, compaction
Current context much lower than totalCompaction or truncationCompaction time, projection

The first is the most common: the page shows visible use, the bill shows actual charges, and reasoning plus cache rules raise the bill.

The second is also common: the session total counts failed attempts, while the bill may charge only successful requests. Here the page looks higher.

The third compares current context with cumulative spend. Compaction shrinks the former and leaves the latter; they are not the same number.

DeepSeek Harness: Reconciliation order

Work from bill to session to request to context. Four layers, fixed order (source):

  1. Bill — confirm period, model, cache rules, and plan discounts.
  2. Session — find the session, confirm input/output totals and request count.
  3. Request — inspect one request's detail for cache, reasoning, and retries.
  4. Context — check compaction and truncation changes to later requests.

After four layers, the gap usually lands on cache, reasoning, retries, compaction, or billing rules. If not, then suspect the meter.

Do not recompute tokens by hand first. Manual counts miss system prompts, tool schemas, images, and attachments, and usually diverge more than the system.

DeepSeek Harness: Verify with one small session

Use a small session, not a long one. Four steps (source):

  1. Single request — send one short task; record page input/output and bill change.
  2. With a tool — send a task that calls a tool; see whether the result enlarges later requests.
  3. Retry — force one retryable failure; check whether the failed attempt counts in the total.
  4. Compaction — trigger compaction; current context drops, the total does not.

Four steps explain most gaps. If a gap remains, check provider billing docs and the metering implementation.

The existing develop-token-meter-and-spill covers metering, dsh-usage-tracking-plugins covers usage plugins, and billion-context-cost-limits covers long-context cost; this article covers the reconciliation order. Separate the scopes before comparing numbers.

ChatGPTClaudeGrok / X / CursorGemini

FAQ

Why does the DeepSeek Harness page show fewer tokens than the provider bill?

In DeepSeek Harness, the page usually shows visible request metering and session projection, while the bill reflects provider billing. Cache rules, reasoning tokens, and retries can make the bill higher.

Do cache-hit tokens count toward the DeepSeek Harness context?

In DeepSeek Harness, cache hits affect billing and request shape, but not necessarily the exact context the model sees. DeepSeek Harness meters them separately, so check the detail instead of only the total.

Does the DeepSeek Harness session total decrease after compaction?

DeepSeek Harness does not work that way. DeepSeek Harness compaction shrinks the next request context; the session total still records requests that already happened. Compare current context with cumulative spend.

Which number should I trust when reconciling DeepSeek Harness usage?

Use the provider bill as the charge and the DeepSeek Harness session meter to explain it. When they differ, check cache, retries, and compaction before suspecting the meter.

Related Terms

token metering
Token metering is DeepSeek Harness's record of tokens in model requests and responses, used for cost, context pressure, and usage.— DeepSeek Harness reference - Token metering
cache hit
A cache hit is a provider reusing a previously computed context segment; it affects billing and request shape, not always the exact visible context.— DeepSeek Harness reference - Token metering
session total
A session total is DeepSeek Harness's cumulative token record for one session; compaction does not erase requests that already happened.— DeepSeek Harness reference - Token metering
compaction
Compaction is DeepSeek Harness replacing older history with a summary under context pressure, reducing the next request's input.— DeepSeek Harness reference - Compaction

Sources