Skip to content

Ghost011118/dsh-balance-meter

151Last commit Aug 14, 2026

dsh-balance-meter DSH plugin

The dsh-balance-meter plugin adds a chip to the composer dock showing your DeepSeek account balance and the current session's estimated cost. It queries the official Get User Balance endpoint and calculates spend based on token usage and official pricing. It automatically fetches the latest pricing page every 6 hours to handle price changes.

How to install the dsh-balance-meter DSH plugin

dsh plugin --profile web add https://github.com/Ghost011118/dsh-balance-meter

Copying does not run this command. Review the repository and version before installing the dsh-balance-meter DSH plugin.

dsh-balance-meter DSH plugin data source

dsh-balance-meter DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-balance-meter DSH plugin can do

  • Display live account balance from DeepSeek API.
  • Estimate current session cost based on token usage and official pricing.
  • Per-model pricing: auto-detects flash vs pro from session request headers.
  • Auto-fetch official pricing page every 6 hours to stay up-to-date.
  • Peak-hour pricing (Beijing 09:00-12:00 / 14:00-18:00) applied automatically when active.
  • Click chip to see per-currency breakdown and per-bucket cost details.
  • Force refresh on error states.

Where the dsh-balance-meter DSH plugin fits

  • Monitor DeepSeek account balance directly from the DSH web interface.
  • Track estimated cost of a session in real-time to manage API spending.
  • Identify which model (flash or pro) is being used and its cost impact.
  • Verify pricing updates after the 2026-08-17 peak/off-peak rollout.
  • Debug cost discrepancies by viewing per-currency and per-bucket breakdowns.

Who the dsh-balance-meter DSH plugin is for

  • DeepSeek Harness users who want to keep an eye on their API balance.
  • Developers building applications with DSH and needing cost visibility.

dsh-balance-meter DSH plugin limitations

  • Requires DeepSeek Harness 0.1.0-rc.6 or newer (web profile).
  • Requires a DeepSeek API key stored in DSH credentials (DEEPSEEK_API_KEY).
  • Balance only updates every 30 seconds by default (configurable).
  • Cost estimation relies on official pricing page; if unreachable, uses built-in presets.

dsh-balance-meter DSH plugin: from the repository README

Quoted from the Ghost011118/dsh-balance-meter README, the upstream source of the dsh-balance-meter DSH plugin. Copyright remains with the original authors.

English | [中文](README.zh.md) DeepSeek account balance and session-cost readout for the DeepSeek Harness (DSH) Web GUI. - Live account balance (queries the official Get User Balance endpoint) - Current session estimated spend (token usage x official pricing) - Per-model pricing: reads the model actually driving each session from its request header (flash vs pro), so the cost tracks the model you used instead of a fixed default - Auto-fetches the official pricing page every 6h, so price changes and the 2026-08-17 peak/off-peak pricing rollout never require a plugin update - Peak-hour band (Beijing 09:00-12:00 / 14:00-18:00) applied automatically once the peak pricing goes live ## Features The composer dock shows a chip with the account total balance and the current session's estimated cost: ``` Balance CNY 4.16 · This session CNY 2.57 ``` Clicking the chip reveals the per-currency balance breakdown (granted + top-up) and the per-bucket cost breakdown (input / cache read / output). Clicking while an error is shown forces an immediate refresh. ## Requirements - DeepSeek Harness `0.1.0-rc.6` or newer (web profile) - A DeepSeek API key stored through the DSH credentials s

Read the full READMERepository license: BSD-3-Clause

dsh-balance-meter DSH plugin questions

How do I install dsh-balance-meter?

You can install the plugin from a git URL using the command: dsh plugin --profile web add https://github.com/Ghost011118/dsh-balance-meter. Alternatively, clone the repository locally and run dsh plugin --profile web add link:$(pwd)/dsh-balance-meter. After installing, restart the dsh web server and refresh the page to see the balance chip.

Why is the balance showing 'unavailable'?

The 'unavailable' state usually indicates an issue with fetching the balance, such as a missing or invalid API key, network problems, or a transient error. The plugin automatically retries on every poll (by default every 30 seconds) and will recover once the underlying condition is resolved. If the issue persists, check that DEEPSEEK_API_KEY is correctly set in the DSH credentials file (~/.dsh/.credentials.yaml) and that the provider route is working.

How often does the balance update?

By default, the balance is queried every 30 seconds. You can customize this interval by setting the refreshIntervalSeconds configuration option in the plugin's composition settings. The minimum allowed value is 30 seconds, but you can increase it to reduce API calls.

Can I force a specific model for cost estimation instead of auto-detection?

Yes. In the plugin configuration, set the model option to 'flash' or 'pro' to force a fixed preset. By default, model is set to 'auto', which detects the model from each session's request header. Explicitly setting a model ignores auto-detection and uses that preset for all sessions.

What happens if the official pricing page cannot be fetched?

If the pricing page is unreachable, the plugin falls back to built-in presets: flash pricing at 0.02 CNY per 1M input, 1 CNY per 1M cache read, and 2 CNY per 1M output. These presets are used until the next successful fetch. You can also override cost values directly in the composition config if needed.