Introduction

If you are already using DeepSeek Harness (DSH) Web GUI and want to view your DeepSeek account balance and local session usage in one place, xavier711/dsh-plugin-deepseek-usage is a usage dashboard plugin for the Web GUI. It adds a “Usage / 用量” entry at the bottom of the left sidebar, putting balance queries, local token statistics, and cost estimation in one panel.

What is this

  • Plugin Name: xavier711/dsh-plugin-deepseek-usage
  • Maintainer: xavier711
  • License: MIT
  • Runtime Environment: DSH Web GUI, requires Node.js
  • One-sentence positioning: Adds a DeepSeek usage panel to DSH Web GUI.

Core Features

Below is an introduction to what it can directly display.

Account Balance

After configuring the DeepSeek API key, it supports querying the official GET /user/balance account balance in real-time. Fields include total, topped-up, and granted.

If there is no API key, local usage statistics are still available, and the balance card will only display a prompt.

Local Usage Statistics

The DeepSeek API does not expose an account-level usage endpoint (sources indicate all candidate paths actually return 404), so local usage data comes from local session logs. The plugin replays the official per-request usage records from local session logs and displays:

  • Today, last 7 days, and all-time statistics
  • 7-day chart
  • Today’s token composition
  • Statistics by model
  • Statistics by workspace

Cost Estimation

The plugin estimates costs by model using the official DeepSeek prices (CNY per 1M tokens) and applies:

  • 2026-08-17 V4 peak/off-peak pricing
  • 2026-08-23 weekend all-day off-peak rule

The sidebar entry and panel header will display the current peak/off-peak indicator, active time window, and the next switch time.

Installation and Enablement

First, confirm that Node.js is installed. Choose one of the following installation methods.

dsh plugin --profile web add git+https://github.com/xavier711/dsh-deepseek-usage.git#v0.4.2

If you do not have a global dsh installed locally, you can use:

npx --yes @deepseek-ai/dsh plugin --profile web add git+https://github.com/xavier711/dsh-deepseek-usage.git#v0.4.2

If the installer prompts for missing pnpm, run:

npm install -g pnpm

Then retry the original installation command.

Method 2: npm Install

dsh plugin --profile web add @xavier711/dsh-deepseek-usage

Method 3: Clone Install

git clone https://github.com/xavier711/dsh-deepseek-usage.git
cd dsh-deepseek-usage
./install.sh

Enablement after Installation

  1. Stop the service in the terminal running dsh web, then run dsh web again; if you do not have a global dsh, you can use npx --yes @deepseek-ai/dsh web.
  2. Refresh the browser page, and hard refresh if necessary.

Once complete, the “Usage” entry will appear at the bottom of the sidebar, above Settings.

Since the plugin is automatically activated via dsh.bundle, manual configuration changes are usually not required.

Optional Configuration

API key

If you want to display the balance card, you can write in ~/.dsh/.credentials.yaml:

DEEPSEEK_API_KEY: sk-xxxx

Or set an environment variable:

DEEPSEEK_API_KEY

When there is no key, local usage statistics are still available; the balance card displays a prompt.

Override Configuration

As needed, you can override configuration in ~/.dsh/profiles/web/cordis.patch.yml via id: deepseek-usage. Listed configuration items include:

balanceTtlMs
maxSessions
sessionConcurrency
balanceTimeoutMs
localTtlMs
newPricingAt
weekendOffPeakAt
peakHours

Please set specific values according to your runtime environment.

Update, Uninstall, and Troubleshooting

npm Install Update

dsh plugin --profile web update @xavier711/dsh-deepseek-usage

Git Install Update

Git installation is a fixed snapshot; updates are not automatic. The plugin will query the GitHub releases feed (hourly cache) when opening the usage panel and display the accurate update command for the new version.

After executing the update command, you need to restart dsh web and refresh the page.

Uninstall

dsh plugin --profile web remove @xavier711/dsh-deepseek-usage

Then restart dsh web and refresh the page.

Common Issues

If you see the warning declares no dsh.bundle, it means an old snapshot is installed. Reinstall using the pinned tag:

dsh plugin --profile web remove @xavier711/dsh-deepseek-usage
dsh plugin --profile web add git+https://github.com/xavier711/dsh-deepseek-usage.git#v0.4.2

Then restart dsh web and refresh the page.

If the “Usage” entry does not appear after installation, first confirm that dsh web has been restarted, and refresh or hard refresh the browser page.

Suitable Scenarios and Notes

This plugin is suitable for users who are already using DSH Web GUI and want to view both DeepSeek balance and local session usage simultaneously.

Please note:

  • The plugin runs with the permissions of the current dsh process; you should check the source code and license before installing.
  • The API key is not embedded in the plugin; it is parsed from the local ~/.dsh/.credentials.yaml or environment variables at runtime and is only used on the host side; the browser bundle does not touch it.
  • Numbers in screenshots in the documentation are synthetic sample data and do not represent real balances, keys, tokens, or session content.

Links

GitHub Repository: https://github.com/xavier711/dsh-plugin-deepseek-usage