DSH Hub

Zenjibad/deepseek-cost-usage-status-plugin

deepseek-cost-usage-status-plugin

UIWeb UI1 GitHub stars· updated 2026-08-25

Live DeepSeek API cost, usage & balance status line for the DeepSeek Harness (DSH) web UI. Packaged DSH plugin — on/off-peak (Beijing-time), session cost, burn rate, account balance.

Install

npx @deepseek-ai/dsh plugin --profile web add deepseek-cost-usage-status-plugin

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

deepseek-cost-usage-status-plugin DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/deepseek-cost-usage-status-plugin.svg)](https://dshhub.dev/plugins/deepseek-cost-usage-status-plugin)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from Zenjibad/deepseek-cost-usage-status-plugin, cleaned of badges and images.

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/stream waterfall, 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~/min in the same display currency, i.e. session cost ÷ elapsed minutes since the session's first model call.
  • Account balance — polled from DeepSeek's /user/balance every 60s using DSH's own DEEPSEEK_API_KEY; degrades to Balance — 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
# or from a local checkout:
dsh plugin --profile web add ./deepseek-cost-usage-status-plugin

Then restart DSH. The plugin renders its line in the conversation.composer.dock slot (a new cell beside the shipped stats cell), fed by GET /deepseek-cost/api.

Requirements

  • DSH 0.1.0-rc.6+ with the web UI and a configured DeepSeek provider.
  • A DeepSeek API key stored as DEEPSEEK_API_KEY in ~/.dsh/.credentials.yaml (reused for the balance read). Without it, balance shows ; the rest still works.

How it works

  • Host half (source of truth): wraps the llm/stream waterfall, forwards every chunk untouched, reads the terminal usage chunk per completed call, accumulates per-session token/model/timing, computes cost from the PRICING table (official CNY, peak-class; idle = 50%) with the Beijing-time peak decision, and polls balance via curl.exe + subprocess. Serves the snapshot over GET /deepseek-cost/api (a webServer route — the packaged-plugin replacement for the dynamic harness.handle RPC seam).
  • Client half: registers in conversation.composer.dock, polls /deepseek-cost/api every 2s, and renders the font-matched line with a green/red peak chip.

User-currency cost display

Cost and burn rate are computed in CNY (the pricing table's basis) and then displayed in your account's currency — the one returned by GET /user/balance (usually USD). That way Cost and Balance share the same unit. The conversion uses a hybrid FX rate:

Related plugins