Introduction¶
When using multi-channel free models in DSH, credits are often scattered across various provider accounts. While the sidebar may list quotas, what you really need during a conversation are two things: how much is left right now, and exactly how much was deducted for this turn. The official statistics bar focuses on context and usage, rather than breaking down balances and single-turn consumption by channel account.
Here we introduce the community client plugin dsh-channel-credits (maintainer: basaltfold). It persistently displays channel credit balances in the statistics bar below the input box and backfills the credit consumption for the current turn at the end of every response. All data is sourced from the channel-pack RPC registered by the locally installed dsh-our-free-model. It does not request external interfaces or read credential files.
What is this¶
dsh-channel-credits is a Web client plugin for DeepSeek Harness (Category: Client). It hooks into two UI slots: the statistics bar displays the total remaining credits (clickable for a force refresh); the turn tail displays “This turn −X credits” before the action row, and can include the nickname of the billed account.
The difference from the community plugin dsh-ofm-balance is that the latter lists channel quotas in the sidebar and only displays balances; this plugin places the balance in the input box statistics bar and performs consumption attribution and asynchronous backfilling for every conversation turn.
Two Mount Points¶
| Slot | Location | Content |
|---|---|---|
conversation.composer.dock |
Statistics bar below the input box card (right side of ⊙ Context Ring) |
e.g., Remaining 9,034 credits, click to force refresh |
conversation.chat.turnTail |
Before the action row at the end of each turn’s response | e.g., This turn −0.31 credits |
The statistics bar entry is positioned via CSS order:1 after the native activity / usage / ContextMeter, becoming the last flex item in that row.
Core Features¶
Remaining Credits¶
The host RPC usage.badge returns balance.total for each account, and the plugin sums them by provider. It only fetches data for providers where accounts.total > 0 in provider.status—the host polls upstream sequentially per account, and full polling might trigger risk control.
Current Turn Consumption¶
Neither the host nor the upstream has a field for single-request consumption, so the plugin measures it using balance deltas: it force-refreshes once as a baseline immediately after the turn ends, then samples at 70s, 120s, and 180s. Once a drop is read, it settles the transaction. Upstream billing latency is measured at about 60–100 seconds, so the value read at the end of the turn is still stale; therefore, asynchronous backfilling is mandatory.
Settlement results are written to localStorage (key dcc:v1:turn:<sessionId>:<turn>), so refreshing the page does not trigger recalculation. Only the latest turn is allowed to claim the delta in the same session; 0 values are also recorded to avoid duplicate settlement.
Dependent RPCs¶
The call format is as follows:
connection.rpc.call('/api', 'channel-pack', { method, payload }, signal)
usage.badge { provider, force }→{ accounts: [{ accountId, nickname, balance: { total, packages } }], windowDays }provider.status { providers }→{ statuses: { <p>: { accounts: { total, enabled }, closed } } }
The host badge cache TTL is 120 seconds, and the plugin polling interval is also 120 seconds; force: true is only used when clicking the statistics bar and during settlement sampling.
Installation and Activation¶
The plugin runs with the permissions of the current DSH process. Before installing, please review the GitHub repository source code and license yourself. After modifying the profile, you must restart the DSH desktop client (the cordis tree is only built at startup).
In the profile’s package.json (path $DSH_HOME/profiles/<name>/package.json):
- Add a local path dependency in
dependencies, or usedsh plugin add(The README does not provide a fixedgithub:owner/repocommand; please follow your local DSH plugin installation method). - Append
"dsh-channel-credits"to the end ofdsh.profile.bundles. - The package’s
cordis.patch.ymlmust includechannel-credits; the client is declared bydsh.client.platform: web.
dependencies example (change the path to the local absolute path):
"dsh-channel-credits": "file:/absolute/path/to/dsh-channel-credits"
Current package version (subject to the repository’s package.json): 0.1.1.
Typical Usage¶
- Ensure
dsh-our-free-modelis installed and configured, and at least one channel account is set up; if not installed,connection.rpccannot findchannel-pack, and this plugin will not render any content. - After restarting DSH, view “Remaining X credits” in the statistics bar below the input box; if the balance is inaccurate, click the entry to force a refresh.
- After completing a conversation turn, wait for the asynchronous backfill at the end of the response (usually requires waiting for upstream billing; the plugin samples within 70s–180s); a display like
This turn −3.91 credits · ACAIindicates that attribution by account has occurred.
Use Cases and Notes¶
Who it is for: Agent developers using dsh-our-free-model in the DSH desktop client who need to directly monitor balances and single-turn consumption in the conversation interface.
Dependency Risk (Important): This plugin reads the private RPC service channel-pack registered by dsh-our-free-model, not the official stable DSH API. dsh-our-free-model enables hot updates (autoReloadWatch) by default; if the upstream adjusts the method names, parameters, or return structures of usage.badge / provider.status, the plugin may silently fail (no error in the interface, just no display).
Known Limitations:
- Mixed units:
clineis in USD,zcodeis in tokens,geminiis in quota, others are displayed as “credits”; when summing multiple providers, only entries with the same unit are accumulated. - Accounts with missing credentials return
balance: nullanderror: '凭据未配置'; the interface displays “Unavailable”, and they are not included in the total. - If the provider is switched during a turn, the delta is calculated into the current provider’s total.
The DSH ecosystem adheres to “Everything is a plugin”; the community directory SkillHub Plugin Page is an independent site and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-channel-credits places channel credit balances in the input box statistics bar and uses balance deltas to asynchronously backfill consumption per turn, making it suitable for use with dsh-our-free-model. For more information, please visit the Directory Page and the GitHub Repository.