dsh-balance-meter: An Account Balance and Session Cost Display Plugin for DeepSeek Harness

ghost011118/dsh-balance-meter

Models & ReasoningVerified
Listed on 2026-08-20
Page last updated 2026-08-20

A DSH plugin showing DeepSeek account balance and live session cost in the Web GUI.

Display account balance and estimated session spend directly in the DeepSeek Harness Web GUI, helping users track costs in real time.

install
dsh plugin --profile web add github:ghost011118/dsh-balance-meter
Category
Models & Reasoning
Platform
DSH-Plugin
Author
ghost011118
Distribution
Plugin

dsh-balance-meter Key Features

Live balance displaySession cost estimatePer-model auto pricingAuto price refresh

dsh-balance-meter Repository

ghost011118
Publisher
ghost011118
Repository
ghost011118/dsh-balance-meter
18
Stars
1
Forks
0
Watchers
4
Open issues
LanguageJavaScript
LicenseBSD 3-Clause "New" or "Revised" License
Website
Repo last push2026-08-14 12:27:02
Repo created2026-08-14 02:54:17
Topics
balancecost-trackingdeepseekdeepseek-harnessdshdsh-plugindsh-web-uiplugin
Default branchmaster

dsh-balance-meter Repo Summary

dsh-balance-meter is a DeepSeek Harness (DSH) plugin (DSH plugin) that provides account balance and session cost readout for the DSH Web GUI. It solves the problem of users not being able to see their DeepSeek account balance and estimated session spend directly in the web interface. Core capabilities include querying the official balance endpoint in real time, estimating session cost based on token usage and official pricing, automatically detecting the actual model (flash or pro) driving each session for accurate cost tracking, and auto-fetching the official pricing page every 6 hours so that the 2026-08-17 peak/off-peak pricing rollout never requires a plugin update. The plugin is maintained by Ghost011118, licensed under BSD-3-Clause, and last updated on 2026-08-14.

What core features does the dsh-balance-meter DSH plugin support?

The plugin displays a chip in the composer dock showing the account total balance and the current session's estimated cost, e.g., 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). If an error is shown, clicking forces an immediate refresh. The plugin is zero-config by default, using DEEPSEEK_API_KEY and the official pricing page, and supports optional composition settings such as model (auto/flash/pro), pricingRefreshHours (default 6), apiKeyEnv, baseUrl, and refreshIntervalSeconds (default 30).

How to install dsh-balance-meter?

Installation requires DeepSeek Harness 0.1.0-rc.6 or newer (web profile) and a DeepSeek API key stored through the DSH credentials seam (DEEPSEEK_API_KEY — the web Models page writes it). The recommended command to install from a git URL is:

bash
dsh plugin --profile web add github:ghost011118/dsh-balance-meter

After installation, restart dsh web and refresh the page. The balance chip appears in the composer dock next to the conversation stats line.

How does dsh-balance-meter estimate session cost?

The plugin reads DSH's durable tokenUsage projection (the same accounting the built-in stats line uses) and converts the four buckets — uncached input, cache read, cache write, output — to money using prices parsed from the official pricing page. Cache-write tokens are not billed separately by DeepSeek and default to 0. In auto mode (the default), it uses the model actually driving the session: each session's request header records the provider/model of the most recent request, and the plugin maps that id (deepseek-v4-flash → flash, deepseek-v4-pro → pro) to the matching per-million prices. A session is therefore priced at whatever model produced its usage, not a hard-coded flash. When no header exists yet or the model id is unrecognized, auto falls back to flash. Setting model: flash or model: pro explicitly forces that preset and ignores auto-detection. Before the 2026-08-17 peak-pricing rollout the current single prices stay authoritative; after it, the peak/off-peak band for the current Beijing hour (09:00-12:00 / 14:00-18:00) is applied. If the pricing page cannot be fetched, built-in presets (flash: 0.02 / 1 / 2 CNY per 1M) are used. Explicit cost.* overrides in the composition config take precedence over any preset.

Which DeepSeek Harness versions and platforms does dsh-balance-meter support?

The plugin requires DeepSeek Harness 0.1.0-rc.6 or newer and is designed for the web profile. It depends on several official DSH client packages (e.g., @deepseek-ai/dsh-client-connection, @deepseek-ai/dsh-token-meter, etc.) to integrate seamlessly with the DSH ecosystem. The plugin is written in JavaScript and installed via git URL, requiring no npm account.

See more DSH plugins at dsh-plugin.org

DSH-Plugin FAQ