Wanbinyu/dsh-billing--packages-dsh-client-ui-billing ↗★ 0
dsh-client-ui-billing
会话成本与配额进度条,位于编辑器停靠栏中,覆盖计费会话投影
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-billing
Per-model cost accounting and session quota progress plugins for DeepSeek Harness (dsh).
dsh-billing(host plugin) — prices provider-reported token usage per model from yourConfig, folds it into thebillingsession projection, and reports optional per-session quota progress. Replay-aware, config-independent fold state, deterministic micro-unit rounding.dsh-client-ui-billing(web GUI plugin) — renders a read-only cost strip in the composer dock (order 15, after GoalBar): session cost in your currency, a quota progress bar with used/limit text, an unpriced-model warning, and the per-model breakdown in a tooltip. Renders nothing until usage exists.
They follow the standard DeepSeek Harness host-projection / client-surface split (the session-stats / ui-goal precedent): the host owns pricing and the fold, the browser renders the host-computed projection.
Install
Both packages are plain npm packages with @deepseek-ai/dsh-* peer dependencies (installed with dsh).
npm install dsh-billing dsh-client-ui-billing
In a dsh profile, add the rows to cordis.patch.yml (see the cordis primer):
- insert:
- id: billing
name: 'dsh-billing'
config:
models:
deepseek-v4-flash:
input: 0.2 # currency per 1M uncached input tokens
output: 0.8 # currency per 1M output tokens
cacheRead: 0.05 # currency per 1M cache-read tokens (absent = 0)
cacheWrite: 0.1 # currency per 1M cache-write tokens (absent = 0)
currency: USD
quota:
limit: 5 # optional per-session cost cap (currency)
- id: ui-billing
name: 'dsh-client-ui-billing'
Prices are examples — set them to your contract rates. A model without an entry still has its tokens counted but prices at zero and joins unpricedModels, so you learn about missing prices instead of silently under-billing. Restart dsh after editing the profile.
Projection
interface BillingProjection {
currency: string
totalCost: number
models: { model: string; cost: number; uncachedInputTokens: number;
outputTokens: number; cacheReadTokens: number;
cacheWriteTokens: number }[]
unpricedModels: string[]
quota?: { limit: number; used: number; remaining: number; percent: number }
}