Preface¶
When writing code with DeepSeek Harness (hereinafter referred to as DSH), billing is based on Tokens, not the number of sessions. A single call is split into cache-missed input, cache hit, and output; auxiliary calls such as sub-agents, compression, and title generation are also included in usage statistics. Starting at 16:00 UTC on August 16, 2026, the official pricing has been tiered by peak/off-peak hours: the unit price for the same conversation can double between morning and evening. Looking only at Token numbers, it is difficult to immediately answer questions like “How much did this round cost?”, “How much have I used today?”, or “How much balance is left in my account?”.
The official DSH repository describes its architecture as “everything is a plugin”: the interface, tools, and billing display can be added or removed at the configuration layer without modifying the Harness source code. Someone in the community has added a dedicated expense ledger to the web interface: real-time session cumulative total, daily total, budget progress, official balance, and a price table aligned with the official pricing page. This plugin is called dsh-cost-meter and is listed in the independent community plugin directory deepseek-harness-plugin.com. This directory has no official affiliation with DeepSeek / 幻方 and is not an official app store.
This article is organized after cross-checking the plugin directory page, GitHub repository README, package.json, CHANGELOG, and DeepSeek official pricing page: what it is, which installation command to use, how to view the ledger in the web interface, and the permission boundaries to clarify before installation.
What It Is¶
dsh-cost-meter is a session expense statistics plugin for the DeepSeek Harness Web UI, categorized under “Tools and Capabilities”. It is maintained by GitHub user Han-1413141, with the repository address at Han-1413141/dsh-cost-meter. The license is MIT, and the primary language is JavaScript. The directory page listed it on 2026-08-15. Both the repository package.json, README badges, and CHANGELOG mark the current version as 1.3.1 (released on 2026-08-16). As of August 17, 2026, querying the GitHub API shows the repository has 58 stars; the directory page previously marked 23 stars, so star counts should be based on official GitHub data.
The compatibility statement in package.json is: DSH >=0.1.0-rc.5, Node.js >=20. The client declaration is "platform": "web", meaning it attaches to the web interface and is not a terminal TUI plugin.
The directory page’s one-sentence description is: Session expenses, daily expenses, history, synchronized with official prices. The repository README expands the capabilities further: real-time expense and Token breakdown on the session badge, official balance and budget frame in the sidebar, summary and daily history on the settings page, peak/off-peak pricing, one-click sync from the official pricing page, and bilingual Chinese-English interface. Starting from version 1.3.0, it also added OpenCode Go subscription quota display; version 1.3.1 added a Codex-style 26-week Token usage heatmap on the settings page.
It addresses a specific pain point: Token usage is already recorded, but the cost needs to be calculated based on the model, whether cache was hit, and whether the call occurred during peak or off-peak hours. The plugin records the usage block of each model call into a local ledger, then converts it to USD based on the price table; currencies such as RMB are only displayed using exchange rates.
Core Features¶
All the following items are sourced from the current repository README, package.json, and CHANGELOG, with no additional embellishments.
1. Current Session Expense Badge¶
Session expenses can appear in two positions, switchable in settings:
- Below the input area
- Session title bar
The badge displays the real-time cumulative cost of the current session, as well as input/cache/output Tokens. Billing is based on the usage block of each model call, including auxiliary calls such as sub-agents, compression, and title generation. The README specifies: the session badge is estimated using current price tiers; daily, monthly, cumulative, and budget calculations are accurately booked based on the actual time of the call. When there is a discrepancy between the two, the ledger shall prevail.
2. Official Balance and Daily Expenses¶
The sidebar can display the official open platform balance: total balance, free credits, and top-ups, with support for automatic and manual refresh. The position can be configured to appear at the top of the sidebar, on the settings page, or both. The balance API calls the official GET {baseURL}/user/balance, reusing the same API Key as model requests.
The daily expense appears at the bottom of the sidebar (above the settings button), as a badge with text like “Today ¥x”; hovering over it shows the number of calls and Token details. When the budget is not enabled, this position is reserved for the daily expense display.
CHANGELOG version 1.3.0 also noted a practical issue: sidebar data used to freeze at the moment the page loaded. The current version uses a polling cycle of approximately 60 seconds (skipping polling when the page is hidden), and refreshes immediately when switching back to the tab.
3. Budget Frame: Reminder, Not Interception¶
After enabling the budget, a rounded corner frame will appear at the bottom of the sidebar: budget quota, used percentage, progress bar, daily expense and its share of the budget, used amount / quota. The thresholds are specified in the README:
- Used ≥ 80%: Warning
- Used ≥ 100%: Overspent
The budget cycle can be selected as Today, This Month, Cumulative, or a custom date range. In narrow rail mode, it collapses into a percentage block.
It is critical to note: the budget and overspend reminders only remind, they do not block calls. After the quota is exhausted, model requests will still be sent normally.
4. Settings Page Ledger: Today, This Month, History¶
The Settings → Expenses page is the overview. The content listed in the README includes:
- Summary cards: Today/This Month/Cumulative expenses and number of calls
- Today’s session details: Number of calls per session, input/cache/output Tokens and expenses
- History records: Aggregated by day, retention days configurable, default 180 days
- Price table: Three-tier prices (base/off-peak/peak) for each model, can be added, deleted, or modified
- Display settings: Badge position, language, detailed frame information, etc.
The ledger is stored at $DSH_HOME/storages/cost-meter/ledger.json, with atomic writes and debouncing. Setting changes are automatically saved immediately (the README specifies a 600ms debounce), with no separate “Save” button. To clear all data, you can delete this file, or use the “Clear All History” option on the settings page. A maximum of 200 session details are retained per day.
5. Peak/Off-Peak Pricing and Official Price Synchronization¶
The price unit is consistent with the official documentation: USD / 1M tokens. The cost formula is according to the README:
Missed Input × cache-miss + Output × output + (Cache Read + Cache Write) × cache-hit.
Cache writes follow the official historical rules, billed at the cache hit price. The ledger amount is always stored in USD; currency and exchange rate only affect display, with the default 1 USD = 7.2 CNY, which can be modified.
The default effective time for peak/off-peak gatekeeping is peakEffectiveAt: 16:00 UTC on August 16, 2026. Before this time, all prices use the base price; after this time:
- Peak hours: 01:00–04:00, 06:00–10:00 UTC, use peak pricing
- All other times use off-peak pricing
This matches the DeepSeek official pricing page opened on August 17, 2026: off-peak hours are half the price of peak hours, and the peak windows are the same two UTC periods mentioned above. The settings page will display the current tier (not yet effective / peak hours / off-peak hours).
“Sync prices from official documentation” will crawl the official pricing page (pre-rendered by Docusaurus server-side), parse the base price table, peak/off-peak price table, effective time, and peak windows, then write them to the local price table. If the page structure changes, the sync will fail and retain the original price table, which can be manually adjusted as a fallback. The sync will overwrite the prices of models with the same name listed on the official page, and custom model entries will not be affected.
The repository also provides docs/AI-PRICE-SYNC-PROMPT.md (and the English version): give the prompt to any AI, ask it to read the official pricing and output a multi-model, time-tiered price JSON, then manually verify before applying to the settings page, RPC, or file. This is an alternative sync path, not automatic billing.
6. Bilingual Chinese-English Interface¶
The interface (all copy on session badges, sidebar, and settings page) supports Simplified Chinese, English, and follows the browser’s default language. The default follows the browser: zh* uses Chinese, all others use English, and the detection result will be written back to the configuration. Server-side prompts (balance refresh, price sync, verification errors) match the interface language. The switch entry is at Settings → Expenses → Display Settings → Interface Language, which takes effect immediately and saves automatically.
7. OpenCode Go Quota and Token Heatmap¶
These two are newer features, not elaborated in the short directory page description, but clearly documented in the repository README and CHANGELOG.
OpenCode Go Subscription Quota (1.3.0): Reads the rolling 5-hour/this week/this month usage percentage and reset time from opencode.ai. The API Key is automatically discovered in the order: “explicit configuration → DSH credential store OPENCODE_GO_API_KEY → environment variables → opencode login session”, and can also be filled in manually. It can be displayed in the sidebar frame, settings page panel, and bottom-right chips; when both Go and budget are enabled, they will be merged into one card. A neutral prompt will appear when not subscribed or the Key is invalid, and it can be disabled in settings to avoid persistent error messages. The API is marked in the README as “opencode.ai official endpoint (community documentation)”; if the structure changes, an error will appear on the settings page.
Token Usage Statistics (1.3.1): The settings page displays historical cumulative Tokens (input/cache/output/number of calls), as well as a Codex-style 26-week daily usage grid heatmap. Days with no usage are semi-transparent squares, days with usage are colored in four tiers of blue, and hovering shows daily details.
You can ignore these two features if you do not have an OpenCode Go subscription or do not need the heatmap; session expenses, balance, budget, and official price synchronization will still work normally.
Installation and Activation¶
The installation command given on the plugin directory page is:
dsh plugin add github:Han-1413141/dsh-cost-meter
The directory page also reminds users: the plugin runs with the permissions of the current dsh process, and may execute code during installation. Please check the source code repository and license before installing. For a reproducible installation, pin the commit hash:
dsh plugin add github:Han-1413141/dsh-cost-meter#<commit>
Replace <commit> with the actual commit hash from the repository, do not use the placeholder verbatim.
The repository README specifies the installation target as the Web profile, and recommends pinning to the release tag v1.3.1 (matching the current package.json version). You need to have pnpm and git installed on your machine:
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.3.1
When git is not available, the README provides a direct GitHub tag archive link:
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.3.1.tar.gz
The environment requirements per the README: Node.js ≥ 20, and DeepSeek Harness with the dsh plugin command (npm install -g @deepseek-ai/dsh). The DSH core is still in developer preview at the time of writing, and the official README notes that there may be breaking changes.
After installation, you must restart dsh web. The reason given in the README is: plugin lines, Typert manifests, and client bundles are scanned at startup.
dsh web
To uninstall per the README:
dsh plugin --profile web remove dsh-cost-meter
Windows users can also use the one-click install.ps1 script in the repository (irm … | iex, the script pins to the tag). The README itself warns “it is recommended to download and review the script before running”. If you can use the above dsh plugin command, there is no need to run the remote pipeline.
For local developer debugging, use symbolic links: refresh the page after modifying lib/client.js:
git clone https://github.com/Han-1413141/dsh-cost-meter.git
cd <parent directory of the cloned directory>
dsh plugin --profile web add link:./dsh-cost-meter
Typical Usage¶
The following steps are all sourced from the interface instructions in the repository README, with no fabricated operations.
1. Check how much the current session has cost¶
Open a session that actually calls the model after restarting the Web UI. The expense badge should appear below the input area or in the title bar. After sending a few rounds of requests, the expense and Token breakdown will update along with the usage. If the badge position is not suitable, go to Settings → Expenses → Display Settings to change to another position or turn it off.
2. Check balance, daily usage, and budget¶
The default order at the bottom of the main page sidebar is: official balance → quota/budget frame → settings button, per the README.
1. Confirm that the local machine can access api.deepseek.com, and that a valid official API Key has been configured in DSH.
2. Hover over the balance row to see the free credits/top-up breakdown; to refresh immediately, go to the balance panel on the settings page and click manual refresh.
3. To control expenses, enable the budget at the top of the settings page, fill in the quota, and select the cycle. After the frame appears, the used percentage will grow with the ledger; ≥80% and ≥100% only change the prompt style, and will not cut off the conversation.
3. Align the price table with official documentation¶
After DeepSeek adjusts prices or changes the peak/off-peak windows, do not just update your mental price list. In the “Data and Sync” section of the settings page, you can one-click crawl the official pricing page. After a successful sync, the prices of models with the same name in the price table will be updated to the base/off-peak/peak tiers on the page. If parsing fails, the old table will be retained, and you can manually edit it according to the official documentation. Custom models you added will not be cleared by this sync.
4. Check which sessions are costing money today¶
Open Settings → Expenses:
- Use the summary cards to see today/this month/cumulative totals
- Use the “Today’s Sessions” table to see the number of calls and three types of Tokens for each session
- Use the “History” section to look back by day
The Token heatmap is suitable for viewing usage density over the past few weeks, but not as a replacement for official bills. To change the interface language, switch it in the display settings on the same page.
Users with OpenCode Go can view the three-tier quota at the top of the settings page, or enable the bottom-right chips. If you do not have a subscription, turn off this panel to avoid unnecessary requests.
Applicable Scenarios and Notes¶
It is particularly suitable for these situations:
- You are already using the DSH Web UI and want to see the cost during the session, not just the Token count
- You need to keep daily, monthly, cumulative, and daily historical records locally for budget planning
- The official peak/off-peak pricing has taken effect, and you want the price table to sync with the pricing page instead of manually copying outdated numbers
- You want to check your official account balance to confirm that free credits have not been used up
Before using, please note the following items, all sourced from the directory page or repository README, with no additional additions:
1. Review the source code and license before installing. The directory page clearly states: the plugin runs with the permissions of the current dsh process, and may execute code during installation. This is a community plugin, not an official DeepSeek component.
2. It only covers the Web profile. package.json declares the client platform as web; do not look for badges and frames in the terminal TUI based on web screenshots.
3. The badge is an estimate, the ledger is the accurate metric. The numbers on the session badge are estimated using the current tier; for sessions spanning peak/off-peak hours, the ledger booked by actual call time shall prevail. Official billing shall still be subject to DeepSeek’s bill.
4. The budget will not stop calls. Overspending only changes the prompt style. To truly stop calls, you need to manually intervene or modify the Harness-side policy; this plugin does not act as a gatekeeper.
5. Balance queries have domain restrictions. The API Key will only be sent to the official domain api.deepseek.com. If `baseURL