Preface¶
DeepSeek Harness (DSH) has built-in token counting in its conversation interface, but billing is in US dollars and the platform side has peak/off-peak pricing differences. If you budget in rubles, or need to compare “how much this session cost” with the built-in token count on the same row, you’d have to look up prices, check exchange rates, and do the math by hand.
Below is a community client plugin, dsh-rub-cost (npm package name @stmol/dsh-rub-cost): it displays the current session’s cost in rubles inside conversation.composer.dock, right next to the built-in token counter; clicking the pill expands a detail card.
What Is This¶
- Position: A DSH client plugin that shows the current session cost (rubles) in the conversation dock, with an optional detail card in the same style as the built-in “Token usage” cell.
- Maintainer: Stmol.
- Category: Client (injects into
@deepseek-ai/dsh-client-ui-conversation,platform: web,immediately: true). - License: MIT (see the repository LICENSE).
The plugin runs with the permissions of your current DSH process; review the source code and license before installing. Community directory page: SkillHub — Stmol/dsh-rub-cost; source code: GitHub — Stmol/dsh-rub-cost.
Interface and Interaction¶
After successful installation, a pill showing the ruble amount (e.g. 0,56 ₽) appears in the dock, adjacent to the built-in token counter.
- The pill is a button: click once to open the detail card; click the pill again, click outside the card, or press Escape to close it.
- Peak/off-peak indicator: during peak hours the ruble amount on the pill is shown in amber, matching the warning color of the tariff row in the card.
- Card contents (as listed in the README): current model; current tariff and switch countdown; API price list under the active tariff (USD / 1M output tokens); CBR (Bank of Russia) USD/RUB exchange rate and its publication date; session cost including subagents; session cost without cache and cache savings; DeepSeek Platform wallet balance. The session cost itself is the ruble figure in the pill and the card title; the card does not repeat the USD total. Token breakdown is not repeated in the card since the adjacent “Token usage” cell already shows it.
Ruble amounts are uniformly rounded to two decimal places; price tables keep one or two extra digits when needed to reflect finer rates.
Billing Rules (How the Plugin Calculates)¶
Formula and Data Sources¶
cost = (uncachedInput + cacheWrite) × cacheMiss + cacheRead × cacheHit + output × output
- Token usage comes from the host’s
tokenUsageprojection; the model comes frommodelSelection.lastUsed. The plugin does not aggregate the session journal itself. - Unit prices follow DeepSeek’s official USD price list (per 1M tokens), converted to rubles using the CBR USD/RUB rate for display; actual account billing remains in USD.
- Exchange rates are fetched from a CBR mirror and cached in
localStorage: when offline, the last known rate is used; when there is neither network nor cache, the corresponding cell shows a dash with the reason explained in a tooltip.
Peak/Off-Peak Hours¶
Peak rates are roughly twice the off-peak rates. The rules are defined by Beijing time on weekdays: 09:00–12:00 and 14:00–18:00 are peak; weekends are off-peak all day. The clock windows printed on the card are converted according to the browser’s timezone (e.g. under UTC+3 they commonly appear as 04:00–07:00 and 09:00–13:00), but the billing rules themselves always follow Beijing time, so opening the card at the same moment in different regions shows the same ruble total; the countdown is derived solely from these rules (on a Friday afternoon it may show remaining time extending into the following Monday, e.g. 63h 00m).
Session Totals and Subagents¶
The pill and card title show the cumulative cost of the current session, not the total account bill, nor a per-request quote. Subagents are priced according to their own routes and aggregated into the “Total with subagents” row; when the card opens, subagent spending is polled every 15 seconds. If any subagent node cannot be read, that row is hidden rather than showing incomplete data.
Installation and Activation¶
The package is published on npm: @stmol/dsh-rub-cost. DSH supports npm packages, Git repositories, tarballs, or local directories as bundle sources.
CLI (as documented in the source):
dsh plugin add @stmol/dsh-rub-cost
GUI: Settings → Plugins → Add plugin, enter @stmol/dsh-rub-cost or the repository URL https://github.com/Stmol/dsh-rub-cost.
Note: the name in package.json must match the name in cordis.patch.yml and the factory id in client.js, otherwise the bundle cannot be built. The plugin does not auto-update; upgrading requires removing it and adding it back. The package version in the current materials is 1.3.0.
After changing prices or exchange rates locally, the bundle must be reinstalled: remove and re-add it in the UI, or run dsh plugin add <path-to-plugin-directory> on the plugin directory.
Typical Usage¶
- Install per the previous section and restart or refresh the DSH web client (the plugin injects into the conversation UI with
immediately: true). - Start a conversation normally; watch the pill in the dock update with token usage.
- Click the pill to view the model, tariff countdown, price list, exchange rate, costs with/without subagents, cache comparison, and balance.
- If using during peak hours, note the amber peak label on the pill and the tariff row.
Default pricing and the CBR mirror work without any additional configuration files; advanced users can edit the constants at the top of client.js (see the next section).
Custom Prices and Exchange Rates¶
The following constants are located at the top of the client.js file:
MODEL_PRICES: unit prices for each modelBILLING_CURRENCYRATE_URL: CBR exchange rate mirror URLDEFAULT_OFFSET_MS: clock fallback offset when the browser reports no timezone (default UTC+3)
After modifying, the plugin bundle must be reinstalled per the “Installation and Activation” section.
Use Cases and Known Limitations¶
Who It’s For
- Developers or heavy users who need to see the current session’s ruble cost at a glance in the DSH conversation interface.
- Users who already use the DeepSeek Platform wallet and want to compare balance and cache savings on the same screen.
- Scenarios that accept the simplified model of “display price recalculated for the whole session at the current tariff” — for estimation rather than line-by-line reconciliation.
Limitations You Should Know (key points from the README)
- Chinese statutory holidays are not modeled: the plugin uses only a year-independent rule of “Beijing weekdays + peak windows”; statutory holiday weekdays are priced as peak days, while DeepSeek actually bills them as off-peak, so the displayed amount and countdown on a holiday may be too high until the holiday ends. Official dates come from the State Council’s annual November notice; the client deliberately does not embed a year-by-year table.
- Ruble total is not the sum of per-request costs: the entire session is repriced at the tariff at card render time; when peak/off-peak switches, the displayed amount may double or halve even without new tokens. The tariff row and countdown describe the “currently active” rule.
- Model switching:
tokenUsageis a whole-session aggregate with no per-route breakdown; after switching models mid-session, the estimate uniformly follows the last used model. - Cache write: billed at the cache miss rate; DeepSeek has not separately published a write price, and on the DeepSeek route this count is often 0.
- Subagents: each uses its own last model and current tariff; child nodes without a selected route fall back to the parent session’s model.
- Balance requests: use a fixed
x-client-versionhardcoded inclient.js; after DSH upgrades you must manually change the code and reinstall. - Timezone: the clock comes from the browser, not the account profile (
remote.account.getProfilehas no timezone);DEFAULT_OFFSET_MSis used when the browser has no timezone.
Conclusion¶
dsh-rub-cost puts “how many rubles this session cost” into the conversation dock, side by side with the built-in token statistics, and consolidates tariff, price list, CBR exchange rate, subagent aggregation, and wallet balance into a single-layer card. The install command is dsh plugin add @stmol/dsh-rub-cost; details and limitations are governed by the repository README.
- Directory page: https://www.skillhub.cn/plugins/Stmol/dsh-rub-cost
- GitHub: https://github.com/Stmol/dsh-rub-cost