huolianJiao/dsh-quota-meter ↗★ 1
dsh-quota-meter
DSH web plugin: show the DeepSeek API key's remaining balance, estimate usable tokens per model (peak/off-peak pricing + measured cache-hit ratio), and chart the real cost of every turn.
AI 분석
核心用途是监控 DeepSeek API 的用量与花费。适合需要精细化控制 API 预算、评估缓存命中率及高峰计价影响的 DSH 网页端用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:huolianJiao/dsh-quota-meter配置 API Key
插件默认读取凭据引用 DEEPSEEK_API_KEY(可在设置页切换)。任选其一:
- 环境变量:
DEEPSEEK_API_KEY=sk-... - 或写入 DSH 凭据文件
$DSH_HOME/.credentials.yaml:
DEEPSEEK_API_KEY: sk-...
配置
- 设置页(推荐):Settings → 「DS API 计费 / DS API Billing」,可视化编辑计价表、高峰时段、回退占比等,保存立即生效。
- 补丁文件(固化默认值):在 profile 的
cordis.patch.yml按 id 覆盖,重启生效:
- id: dsh-quota-meter
config:
apiKeyEnv: DEEPSEEK_API_KEY
baseURL: https://api.deepseek.com
pollIntervalMs: 60000
summaryModel: deepseek-v4-pro
peakWindows:
- { start: "09:00", end: "12:00" } # 北京时间,[start, end)
- { start: "14:00", end: "18:00" }
pricing: # 元 / 百万 token
- model: deepseek-v4-flash
offPeak: { input: 1.5, cacheHit: 0.05, output: 4.5 }
peak: { input: 3.0, cacheHit: 0.10, output: 9.0 }
- model: deepseek-v4-pro
offPeak: { input: 4.5, cacheHit: 0.15, output: 13.5 }
peak: { input: 9.0, cacheHit: 0.30, output: 27.0 }