dsh-web-billing
RMB/USD token-billing plugin for DSH web: official-policy auto pricing (incl. peak/off-peak), per-message ledger, account balance, locale-driven currency display
AI 분석
核心用途是为 DSH Web 界面提供人民币/美元 Token 消费统计与账单明细展示。适合需要监控 API 额度消耗、分析使用成本或进行多模型消费对比的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:bpc-oss/dsh-web-billing配置参考
| 键 | 默认 | 说明 |
|---|---|---|
currency | CNY | 币种标识 |
symbol | ¥ | 人民币展示符号 |
symbolUsd | $ | 美元展示符号 |
displayCurrency | auto | auto=跟随界面语言(英文界面显示 USD);CNY/USD=强制指定 |
timezone | Asia/Shanghai | 峰谷时段判定时区(IANA) |
peakWindows | [[9,12],[14,18]] | 高峰时段(本地小时,[start,end)) |
officialPricing | auto | auto=官方政策自动计价;off=只用 prices |
prices | {} | 用户价格表(覆盖/兜底,单位 ¥/1M,同时作用于美元价) |
usdPrices | {} | 美元价覆盖(可选,单位 $/1M) |
policyOverrides | [] | 追加的官方政策条目(since 必填,prices 或 peak+offPeak) |
persistPath | ~/.dsh/storages/web-billing.json | 账本文件路径 |
maxRecent | 20000 | 最近流水保留条数 |
maxMessagesPerSession | 2000 | 每会话消息明细保留条数 |
loopbackOnly | true | /billing 端点仅允许回环地址访问 |
balance.enabled | true | 是否查询并展示账号余额 |
balance.endpoint | https://api.deepseek.com/user/balance | 余额接口地址(DEEPSEEK_BASE_URL 环境变量存在时以其为前缀) |
balance.apiKeyEnv | DEEPSEEK_API_KEY | 解析 API key 的凭证引用(经 ctx.credentials 或环境变量) |
balance.refreshMs | 60000 | 余额刷新间隔 |
balance.timeoutMs | 5000 | 余额请求超时 |
单价字段语义:input=缓存未命中输入,cacheRead=缓存命中输入,output=输出
(¥ / 百万 tokens)。