DeepSeek Harness (DSH) adopts a plug-in architecture. Developers using it need to monitor account balance, today’s spending, and token usage in real time. rickyfu0625-cell/dsh-billing-dashboard is a plug-in designed for this need. It provides a floating capsule in the bottom-right corner and a full panel to display the balance, spending trends, and top-up entry.
Core Features¶
1. Account Balance Monitoring¶
The plug-in reads data from DeepSeek’s official /user/balance endpoint and displays the total balance, along with the breakdown between topped-up funds and gifted funds. When the balance is lower than ¥5, the balance is highlighted in red.
2. Today’s Spending and Token Statistics¶
- Spending statistics: Supports two modes.
- Official first: If
DEEPSEEK_PLATFORM_TOKENis configured, the plug-in preferentially calls the official usage API to retrieve today’s spending. If the token is invalid, the label is highlighted in red. - Local estimation: If no token is configured or the API call fails, the plug-in replays the persisted session logs under
$DSH_HOME, aggregates tokens fromassistant/messageevents, and converts them to spending based on official pricing. - The data source can be switched manually in the panel, and the setting is persisted.
- Official first: If
- Token breakdown: Tracks today’s input tokens, output tokens, cache hits, cache writes, and the specific counts for the reasoning breakdown.
3. Trend Chart and Top-Up¶
- 7-day spending trend: Provides a line chart showing daily spending for the last 7 days, with data labels.
- One-click top-up: The panel includes a “One-click Top-Up” button. Clicking it redirects directly to
platform.deepseek.com/top_up.
4. UI and Interaction¶
- Floating capsule: Provides a draggable floating capsule in the bottom-right corner. In the collapsed state, it shows a summary of “Today’s Spending” and “Current Balance” along with a refresh button. In the expanded state, it shows the full panel; clicking outside the panel collapses it.
- Position persistence: The capsule position automatically adapts to the viewport after window resizing or page refresh.
- Official token update: Provides an “Update Official Token” button, allowing users to paste a new token and write it to the configuration after validation succeeds.
- Theme adaptation: Uses only
--dsw-*theme variables and follows the light/dark theme of DeepSeek Harness. - Bilingual support: The UI language follows the DSH language setting.
Installation and Enablement¶
Install the plug-in from the command line:
dsh plugin --profile web add github:rickyfu0625-cell/dsh-billing-dashboard
After installation, restart the dsh web process and refresh the browser page. The new bundle is assembled and takes effect at startup.
Data Logic and Scope¶
Runtime Environment Dependencies¶
This plug-in is only compatible with the DeepSeek Harness (DSH) environment and cannot run in other harnesses such as Claude Code or Codex. It depends on DSH services such as webServer, sessionPersistence, credentials, slots, and locale.
Models and Pricing¶
- Model identification: Only spending for DeepSeek official models is tracked. Detection is based on whether the provider is
deepseek-officialor whether the model ID starts withdeepseek-(for example,deepseek-flash). Non-DeepSeek models are not counted. - Price synchronization: On the first request each day, the plug-in fetches the official pricing page, parses the current prices, and persists them. If the prices differ from the effective prices, subsequent messages are converted using the new prices.
Notes¶
- Balance reading:
DEEPSEEK_API_KEYmust be configured (in DSH Settings → Models). The key is used only for reading and does not leave the host. - Official data: Retrieving official spending data requires
DEEPSEEK_PLATFORM_TOKEN(it can be obtained through browser DevTools). If it is not configured, the plug-in automatically falls back to local estimation mode.