README
💰 DeepSeek Balance Monitor & Usage Stats
A DeepSeek Harness (DSH) plugin — balance monitoring · official top-up link · Miyu-style usage statistics · third-party plugin manager
✨ Features · 🖼 Screenshots · 📥 Install · ⚙️ Configuration · 🎮 Usage · 🗑 Uninstall · 🏗 Architecture · ❓ FAQ
✨ Features
| Module | Capability |
|---|---|
| Balance monitoring | Monitors DeepSeek API balance (CNY / USD dual balance pool) with parallel multi-account queries; auto-reads the DSH credential DEEPSEEK_API_KEY — no manual entry needed |
| Low-balance alerts | Independent CNY / USD thresholds (default ¥10 / $2, configurable); the balance bar turns red when below threshold |
| One-click top-up | Jumps straight to the official DeepSeek top-up page platform.deepseek.com/top_up, plus a usage-details page link |
| Usage statistics | 1:1 recreation of the Miyu WebUI usage page: stat tiles / GitHub-contribution-style usage calendar / three-segment stacked trend bar chart / model consumption donut chart with detail table / recent 50 call records |
| Performance metrics | Turns · steps · LLM duration · tool-call duration · avg first-token latency · tok/s · cache hit rate |
| Third-party plugin manager | Lists unofficial (non-@deepseek-ai) web plugins: package name / local path / Bundle rev / dependencies, with a one-click "Open Directory" to locate source code |
| Model tool | Registers the query_api_quota tool — just ask "How much DeepSeek balance is left?" and get a balance summary |
Charts use Miyu's chart / heat palettes (blue / gold / rose / purple + blue-purple heat scale) and auto-adapt to dark / light themes.
🖼 Screenshots
| Screenshot | Description |
|---|---|
![]() |
Three icon entries on the right of the input toolbar (💰 Wallet / 📊 Usage / 🧩 Plugins) plus a persistent balance bar below |
![]() |
Balance monitoring panel: balance table, low-balance alerts, account config, thresholds & refresh interval, top-up entry |
![]() |
Usage page top: range switcher, stat tiles, live performance metric bar, GitHub-style usage calendar |
![]() |
Usage page bottom: trend bar chart, model consumption details, call record details |
![]() |
Third-party plugin manager: stat badges, plugin list, "Open Directory" action |
📥 Install
Prerequisites
- DeepSeek Harness installed and running
- (Optional) DeepSeek API Key — get one at platform.deepseek.com; if
DEEPSEEK_API_KEYis already configured on this machine, the plugin auto-reads it at startup — no manual input required
One-click install (recommended)
# Installs automatically (install deps → write compose patch → prompt restart)
curl -fsSL https://raw.githubusercontent.com/Francis-Xavier-code/dsh-balance-plugin/main/install.sh | bash
Restart DeepSeek Harness after installation — three icon buttons appear on the right of the input box. Use DSH_PROFILE=<name> to target another profile.
Manual install (equivalent)
# 1. Install the dependency (use the github: source, not the bare package name — a third party owns a same-named package on npm)
dsh plugin --profile web add github:Francis-Xavier-code/dsh-balance-plugin
# 2. Append the plugin line to ~/.dsh/cordis.patch.yml (skip if already present)
- insert:
- id: dsh-balance-plugin
name: 'dsh-balance-plugin'
# 3. Restart DeepSeek Harness
⚙️ Configuration
Click the wallet icon (💰) on the right of the input toolbar to open the "Balance Monitor" panel:
| Setting | Description |
|---|---|
| Account list | Click "+ Add Account" to add; each account can have a name and API Key |
| API Key input | Enter the plaintext Key, or reference an environment variable like $env:DEEPSEEK_API_KEY; leaving an existing Key empty keeps it unchanged |
| Auto-read account | At startup, if the DSH credential DEEPSEEK_API_KEY is detected, an "Auto-read · DSH credential" account is created automatically |
| CNY / USD alert thresholds | Triggers a low-balance alert when the balance of the corresponding currency drops below the threshold (default ¥10 / $2) |
| Refresh interval | 30 seconds ~ 30 minutes (default 5 minutes); "Save Config" triggers an immediate refresh |
🔒 Key security: API Keys are kept only in the plugin process memory on your machine and are never uploaded to any third party; the UI only shows masked values.
🎮 Usage
| Entry | Location | Description |
|---|---|---|
| 💰 Wallet icon | Right of the input toolbar | Opens the balance monitor panel (config / balance / top-up) |
| 📊 Bar-chart icon | Right of the input toolbar | Opens the usage statistics panel |
| 🧩 Four-grid icon | Right of the input toolbar | Opens the third-party plugin manager panel |
| Persistent balance bar | Below the input box | Real-time balance summary, ↻ refresh, top-up link; turns fully red on low balance |
query_api_quota tool |
Model calls | Just ask "How much DeepSeek balance is left?" |
All panels are centered overlays: click the backdrop or "✕ Close" to exit.
🗑 Uninstall
# One-click uninstall (removes dependency + cleans the compose patch)
curl -fsSL https://raw.githubusercontent.com/Francis-Xavier-code/dsh-balance-plugin/main/uninstall.sh | bash
Manual equivalent:
dsh plugin --profile web rm dsh-balance-plugin
# and remove the corresponding two lines from ~/.dsh/cordis.patch.yml
Restart DeepSeek Harness after uninstalling.
🏗 Architecture
Host (Node.js process)
├─ Balance query: shell runs curl → api.deepseek.com/user/balance (Bearer auth)
├─ Usage aggregation: real-time session/event listening + 90-day history scan (deduped by seq)
├─ Third-party plugins: clientModules.graph() + clientPath() + open -R to locate
├─ RPC routes: /bmon/api/get-state · refresh · recharge · set-config ·
│ get-usage · list-plugins · open-plugin-dir
└─ Model tool: query_api_quota
Client (browser)
├─ Entry: 3 SVG icon buttons on the right of the input toolbar
├─ Overlays: self-rendered fixed panels inside the component (no overlay slot dependency)
└─ Charts: Miyu chart/heat palettes, dark/light adaptive
❓ FAQ
Q: Will the plugin still be there after a restart?
A: Yes — static plugins are installed persistently and survive restarts. Manually configured account keys reset (the auto-read DEEPSEEK_API_KEY account needs no reconfiguration and restores automatically after restart).
Q: I can't see the entry button at the bottom of the sidebar? A: The DSH sidebar bottom slot is exclusively occupied by the official Cordis panel plugin. This plugin's entry is fixed on the right of the input toolbar and does not depend on that slot.
Q: Will my Key leak? A: No. Keys are kept only in the plugin process memory on your machine and the UI only shows masked values; neither the source code nor the README contains any secrets.
Q: Balance query fails?
A: Check the error hint in the panel: no Key configured (API Key not configured), missing environment variable (Environment variable xxx not set), invalid Key (401 error message), and handle accordingly.
Q: No historical usage data? A: The plugin scans session events from the last 90 days at startup; "avg first token" only counts streaming data captured in real time after the plugin is running.
Q: Why not use dsh plugin add dsh-balance-plugin?
A: A third party owns a same-named package on npm (dsh-balance-plugin@0.1.0), so the bare name would install the wrong one. Use the one-click script or the github: source (see Install).
💬 QQ Community
📄 License
更多「插件工具」插件
api-relay-audit
作者 toby-bridges
本地 AI API 中转与 LLM 代理安全审计工具,可检测提示注入、模型替换、工具调用篡改、SSE 异常与 Web3 钱包风险。
dsh-context
作者 bowenliang123
Best DeepSeek Harness plugin for context insight and management, with context dashboard / browser and context command, for context statistics, composition, breakdown, evolution details, understanding how the context is made of, and how it evolves. 一站式 DeepSeek Harness 上下文可视化插件,Context 面板及浏览器与 Context 命令,透视上下文组成、演进、压缩、剪枝等事件与动作。
awesome-ai-pedia
作者 awesome-ai-pedia
AI skills大全 mcp ai知识库 Agent 全维度 AI 资源百科,DSH插件 收录大模型、智能 Agent、RAG 检索增强、多模态、MLOps、AI 应用工具、AI面试集、Vibe coding 大全、零基础学习路线,持续更新前沿 AI 开源项目,开发者一站式 AI 导航库
awesome-deepseek-harness-plugins
作者 zhiyuan-fan
DeepSeek Harness 插件精选清单,收录插件、扩展、工具、技能、客户端与集成资源,中英双语。





