DSH Sub-agent Usage & Billing: Sessions, Concurrency, Invoices

Author
DeepSeekAgent.io Editorial Team
Published
Updated

The token total shown by a DSH parent session may not equal total provider usage. In one community run, the interface showed 7,874,011 tokens while the provider charged ¥54.77 for roughly 12 minutes. Inspection later found 42 Sub-agents. Those figures cover different scopes: parent-session events, child-session calls, and the provider's account-level billing system.

This article uses that run as an audit case and maps the relationship between DSH parent sessions, Sub-agent sessions, and provider invoices.

Case data

ItemCommunity record
Runtimeabout 12 minutes
DSH interface7,874,011 tokens
Provider charge¥54.77
Sub-agents42
API cadenceabout one request every 1.45 seconds
Context per requestabout 67K tokens

This is one community run, not a fixed cost for DSH or V4.1 Flash. It provides a useful diagnostic pattern: when the session total and invoice diverge, inspect child sessions before estimating price from the visible number.

Three accounting scopes

Parent-session events

The DSH interface aggregates provider-reported Usage from events in the current Session. Model requests, tool loops, and context processing performed by the parent Agent are represented there.

Sub-agent sessions

Sub-agents have separate Sessions and logs. The parent can record their creation and completion without adding every child model call to the parent's visible token total. With 42 Sub-agents, the parent figure may explain only part of the account activity.

Provider invoice

The provider aggregates actual requests by account or API key. Billing may distinguish input, output, cache reads, cache writes, and reasoning tokens. The final amount must be reconciled against provider line items and pricing, not one blended token figure.

How concurrency expands usage

Sub-agents parallelize exploration and task execution. Each child Session can carry a system prompt, task context, tool results, and its own history. Forty-two branches can repeatedly process shared context even when each branch runs only a few steps.

total usage
  = parent Session model calls
  + all child Session model calls
  + retries, resumes, and continued runs

If child Sessions can create more children, audit the full Session tree rather than only direct descendants.

Why total tokens are not enough

Reconcile at least these dimensions:

  • input and output tokens;
  • cache reads and cache writes;
  • reasoning tokens or provider-specific units;
  • model IDs and effective routes;
  • successful, retried, and interrupted requests;
  • parent and child Sessions.

In the community case, a request roughly every 1.45 seconds combined with about 67K tokens of context. High cadence and long context can accumulate substantial input usage within minutes.

A repeatable audit

1. Fix the time window

Record start and end times, timezone, API key, and model ID. Filter the provider report to that same window so activity from other applications is excluded.

2. Export the Session tree

Starting from the parent, list every direct and indirect Sub-agent. Record at least:

FieldPurpose
Session IDdeduplication and joins
Parent IDreconstruct the tree
Start and end timealign provider requests
Model IDmap the pricing tier
Input/output Usagecalculate DSH-side totals
Statusseparate completed, cancelled, failed, and retried runs

3. Aggregate per Session

Calculate the parent and each child separately before producing a tree total. Keeping branch totals visible makes an abnormal child easier to identify.

4. Reconcile provider detail

Align time, model, and request count. If a gap remains, inspect cache billing, reasoning tokens, retries, and invoice delay.

5. Record observability gaps

Separate fields visible in the current DSH UI, exportable from DSH logs, and visible only in the provider account. Keep missing values empty instead of replacing them with estimates.

Controlling Sub-agent cost

Bound task decomposition

Set the permitted number of child tasks, the expected deliverable for each, and a stopping condition. A narrow file-location task rarely needs many similar exploration branches.

Limit concurrency

Choose a concurrency ceiling that matches provider rate limits, budget, and workspace capacity. The experimental Team profile in v0.1.6-alpha.1 raises its default teammate creation limit from 8 to 16, making an explicit local policy more important.

Minimize repeated context

Send each child only the files, interfaces, and acceptance criteria it needs. Return structured findings instead of injecting every exploration log back into the parent.

Use provider budgets

Source analysis of the pinned revision found no turn-level maxCost, costLimit, or spendLimit fuse. Use provider budgets, quotas, and alerts as the account-level boundary, with an accessible manual cancellation path.

Monitor the whole tree

A useful dashboard shows the parent Session, active child count, cumulative requests, Usage, and estimated cost. A token count for only the current page leaves concurrent activity outside the operator's view.

Relationship to long Agent loops

The 50-turn simple-task case concentrates cost inside one Turn as checks continue and history grows. This case concerns parallel child sessions. The first needs step and stopping boundaries; the second needs Session-tree accounting, concurrency limits, and account-level budgets.

FAQ

Is the DSH token display wrong?

It represents Usage in the current Session's visible events. A parent total is not an account total when Sub-agents run in separate Sessions.

Can ¥54.77 be converted into one token price?

No. The calculation needs input, output, cache, and reasoning-token detail plus the effective model route for every request.

What should I inspect first?

Inspect the Session tree and active Sub-agent count, then aggregate Usage for every child in the same time window as the provider invoice.