Skip to main content

How to use dsh-usage-dashboard

Add a balance and usage dashboard for DSH Web: display official account balance, today's and monthly consumption, model and session cost rankings, cache savings, and bill estimation for peak-valley pricing effective 2026-08-17.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

dsh-usage-dashboard

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add @cassius0924/dsh-usage-dashboard

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • 余额 + 今日消耗,一眼就够。
  • 可拖动,松手自动吸附四角;边界避开侧边栏、右侧详情面板、会话顶栏和输入框——不会挡住发送按钮。
  • 可收起成一行;显示/隐藏、所在角落、收起状态都会记住,刷新页面后原样回来。
  • 余额跌破预警线时,状态点和余额数字一起转成警示色。
  • 60 秒自动刷新余额。今日消耗读共享缓存,点 ↻ 同时刷新两者。

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

What to do if the "Quota" tab is not visible after installation?

This tab is attached to the top bar of a single session. First enter any existing session (not the New Session homepage) and refresh the page to see the three tabs: Chat / Trajectory / Quota. There's no tab bar entry on the home screen's right-click menu. The balance window is permanently fixed in the bottom right corner and will appear even without opening a session (README.md:130 / src/client/index.tsx:50-90).

What to do if the balance is inaccurate or shows "DEEPSEEK_API_KEY not configured"?

This plugin reuses the DeepSeek API Key from the model settings, and the balance comes from the official /user/balance endpoint. Please fill in the Key in DSH "Settings → Model", or place it in $DSH_HOME/.credentials.yaml as DEEPSEEK_API_KEY, and restart dsh to take effect (README.md:127 / src/usage.ts:20-63).

What is the "cost" based on and why does it not match the official bill?

It's an estimate. The rules are all concentrated in src/pricing.ts: billing is done line by line based on "model + whether the time falls in peak window"; usage before 2026-08-17 follows the old fixed price, after which Beijing time 09:00-12:00 and 14:00-18:00 are peak hours, the rest are off-peak (off-peak is half of peak). Unrecognized models are estimated on the more expensive side of deepseek-v4-pro. Does not include platform discounts or usage of gift credits; refer to the official DeepSeek bill (README.md:134-149 / src/pricing.ts:1-110).

Does it take a long time to open the dashboard for the first time?

Because "usage" is aggregated by replaying all local DSH session logs, which takes about 5 seconds on this machine. Therefore, the server memorizes this result for 5 minutes, and the client also initiates prefetching when loading; when data is empty, the interface shows skeleton placeholders instead of empty text. To see the latest numbers immediately, click the ↻ button in the top right (README.md:195 / src/index.ts:30-31 / src/client/index.tsx:46-48).

Is this local data? Will other devices/multi-accounts be counted together?

No. The coverage card clearly states that the data range is "DSH session logs on the current device", excluding other devices, direct DeepSeek platform calls, or locally deleted logs. Before pagination, it will show: how many sessions were scanned, how many corrupted records were skipped, and the coverage time of the earliest/latest record (README.md:193 / src/contract.ts:161-176 / src/client/locales.ts:65-66).

How to adjust the balance alert threshold?

Change it in "Settings" at the end of the "Quota" tab, default is ¥10, fill in 0 to turn off. When it falls below, warnings appear at both the top of the dashboard and the floating window status point; it will also calculate "how many days the recent usage can last" for the user (README.md:100-105 / src/client/store.ts:39-52 / src/client/dashboard.tsx:1097-1100).

What should be noted when uninstalling?

Just run dsh plugin --profile web remove @cassius0924/dsh-usage-dashboard and then restart dsh web. The plugin doesn't write its own files or introduce background processes; the only trace is a set of preference keys prefixed with dsh-usage-dashboard:pref: in browser localStorage, plus dsh-usage-dashboard:balance / :usage caches. Clearing the cache or reinstalling in the same location will bring them back.

Can changing the built-in price table keep up with DeepSeek price adjustments?

When DeepSeek adjusts prices again, just modify the src/pricing.ts file (pro / flash two tiers × cache hit / miss / output three columns). This plugin does not have a "one-click sync official pricing" function; if you want to align with the official bill, please modify this file and rebuild when updating (src/pricing.ts:13-14).

— source: plugin_wiki.faq_json

Compatibility

  • DSH: 未声明
  • Node: >=20
  • Platforms: 跨平台

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule