Zenjibad/deepseek-cost-usage-status-plugin ↗★ 0
deepseek-cost-usage-status-plugin
用于DSH Web UI的实时DeepSeek API费用/用量/余额仪表盘:在输入区下方新增统计行,展示峰值/非峰值时段、会话费用、每分钟消耗率、账户余额及当前模型
AI 分析
核心用途是实时监控和统计DeepSeek API的消耗与花费。适合高频调用API、需要精确控制Token预算及关注账户余额的开发者和企业用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Zenjibad/deepseek-cost-usage-status-plugin说明文档
阅读完整 README ↗DeepSeek Cost / Usage / Status Plugin for DeepSeek Harness
A packaged Cordis plugin for DeepSeek Harness (DSH) that adds a second, colored status line under the shipped conversation stats line, showing live DeepSeek API cost, usage, and account balance.
● Off-peak 00:47 · −50% · Cost ¥0.0412 · ~¥1.23/min · Balance ¥12.42 · Model deepseek-v4-flash ← CNY account
● Off-peak 00:47 · −50% · Cost $0.0057 · ~$0.17/min · Balance $1.73 · Model deepseek-v4-flash ← USD account (cost auto-converted from CNY)
Features
- On / off-peak indicator — green when off-peak (idle), red when peak, using DeepSeek's official Beijing-time peak windows (09:00–12:00, 14:00–18:00). The clock shows your local timezone; the decision is Beijing-time so the color matches what DeepSeek actually bills.
- Session cost — real per-session token usage accumulated from the
llm/streamwaterfall, priced with official CNY rates including the 50% off-peak discount, then converted into your account's currency (from the balance API) so cost and balance are directly comparable. - Burn rate —
~/minin the same display currency, i.e. session cost ÷ elapsed minutes since the session's first model call. - Account balance — polled from DeepSeek's
/user/balanceevery 60s using DSH's ownDEEPSEEK_API_KEY; degrades toBalance —if the key is unavailable/network fails. - Current model + reasoning effort.
- Font-matched to the shipped stats line (12px/20px, muted tertiary color, centered) so it reads as the same family.
Quick start
This is a packaged profile plugin — install once with the official CLI, it loads on every DSH boot and survives restarts (no cordis_define):
dsh plugin --profile web add deepseek-cost-usage-status-plugin
### Configuration
Set from a patch layer, e.g. `$DSH_HOME/cordis.patch.yml`:
```yaml
deepseek-cost-usage-status-plugin:
config:
fallbackFxRate: 7.2 # CNY per 1 USD — used when the live FX fetch fails
fxRefreshMs: 3600000 # live FX refresh interval (default 1 h)
| option | default | meaning |
|---|---|---|
fallbackFxRate | unset | Fixed CNY→display-currency rate used when the live FX fetch fails |
fxRefreshMs | 3600000 | How often to refresh the live FX rate (min 60 000) |
The currency symbol follows the account currency (¥, $, €, £, …); unmapped ISO codes render as their 3-letter code.