Preface¶
DSH’s philosophy is “everything is a plugin.” When calling the DeepSeek API in DSH web, how much the current session costs, the daily cumulative total, and the remaining account balance are usually scattered across different locations. bobcat848/dsh-calculator solves this display issue: it places DeepSeek API costs and account balance in a floating card at the top-right corner of the DSH web GUI, which can also be collapsed into a pill.
What This Is¶
Below is an introduction to bobcat848/dsh-calculator.
- Maintainer:
bobcat848 - License:
MIT - Current version:
1.3.4 - Positioning: A DSH web plugin that displays DeepSeek API costs and account balance in the top-right corner of the DSH web GUI, collapsible into a pill.
Core Features¶
- Displays a DeepSeek API cost card in the top-right corner of the DSH web GUI. Clicking
×collapses it into a pill; clicking the pill expands it. - Displays the current session cost, broken down by model.
- Displays the cumulative cost of all sessions for the current day, broken down by model; calculated based on the local timezone and reset at local midnight.
- Displays the DeepSeek API account balance, fetched via
GET /user/balance, with a 30-second cache. - Only bills for the
deepseek-officialroute; otherprovider/modelentries are displayed as not billed. - Calculates charges based on Beijing peak/off-peak pricing; starting from 2026-08-23, Saturdays and Sundays are billed at half price all day.
- Provides a Chinese/English interface (
zh/en) based on the browser language.
Installation and Activation¶
The installation writes to the plugin directory:
~/.dsh/profiles/node_modules/dsh-calculator
And appends a loader line to:
~/.dsh/profiles/web/cordis.patch.yml
macOS / Linux¶
Online installation:
curl -fsSL https://raw.githubusercontent.com/bobcat848/dsh-calculator/main/install.sh | bash
Windows PowerShell¶
Online installation:
irm https://raw.githubusercontent.com/bobcat848/dsh-calculator/main/install.ps1 | iex
Local Clone Installation¶
First, clone the repository:
git clone https://github.com/bobcat848/dsh-calculator.git
After entering the repository, run the local installation script:
bash install.sh
For Windows PowerShell:
.\install.ps1
Restart and Verify¶
After installation, run the following command to restart DSH web:
dsh web --port 3080
Changes to cordis.patch.yml can typically be hot-reloaded via HMR.
Open or refresh:
http://127.0.0.1:3080
Check the cost card in the top-right corner. Click × to collapse it into a pill, and click the pill to expand it.
Behavior When API Key Is Missing¶
The plugin requires a DeepSeek API key and does not need additional configuration. If the key is missing, the balance card will display a friendly error message, while the cost panel continues to work.
Uninstallation¶
Delete the plugin directory:
rm -rf ~/.dsh/profiles/node_modules/dsh-calculator
And remove the corresponding insert line from:
~/.dsh/profiles/web/cordis.patch.yml
Use Cases and Notes¶
Suitable for developers using the DeepSeek API in DSH web who want to view session costs, daily cumulative costs, and account balance in one place.
Please note:
- Costs are estimates and may differ from official billing statements.
- The plugin runs with the permissions of the current
dshprocess; please review the source code and license before installation. v1.2.0+is only compatible with DSH versions that provide theshell.overlayslot; for older DSH versions (with theasideslot), please usev1.1.x.- The
z-indexfix sets[data-shell-overlay]toz-index:60, below modals/overlays. - Browsers tested:
Chrome 151(Chromium); Safari/Firefox have not been verified. - The community directory is an independent site and has no affiliation with DeepSeek.
- This project has no association with DeepSeek.
Links¶
Community directory:
https://www.skillhub.cn/plugins/bobcat848/dsh-calculator
GitHub:
https://github.com/bobcat848/dsh-calculator