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

  1. 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.
  2. Displays the current session cost, broken down by model.
  3. 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.
  4. Displays the DeepSeek API account balance, fetched via GET /user/balance, with a 30-second cache.
  5. Only bills for the deepseek-official route; other provider/model entries are displayed as not billed.
  6. Calculates charges based on Beijing peak/off-peak pricing; starting from 2026-08-23, Saturdays and Sundays are billed at half price all day.
  7. 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 dsh process; please review the source code and license before installation.
  • v1.2.0+ is only compatible with DSH versions that provide the shell.overlay slot; for older DSH versions (with the aside slot), please use v1.1.x.
  • The z-index fix sets [data-shell-overlay] to z-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