echo804/dsh-billing-balance
echo804★ 0JavaScript最后同步: 2026-08-14
在deepseek-harness中动态查询apikey的余额和本次会话的消耗金额
README 摘要
dsh-billing-balance A static plugin for DeepSeek Harness that adds an API balance and per-session cost estimate readout to the composer stats line (the row under the input box showing cache-hit rate, tokens, etc.). DeepSeek Harness 静态插件:在输入框下方的统计栏(显示缓存命中率、token 等那一行)追加 API 余额 与 本会话消耗金额估算 。 Features / 功能 - 余额 (Balance) : queries GET {baseURL}/user/balance with your DEEPSEEK API KEY and shows 余额 ¥xxx (currency follows the account). - 本会话消耗 (Session cost) : sums the tokenUsage projection (uncached / cache-read / cache-write / output) × DeepSeek's official CNY pricing (输入 ¥2/M、缓存命中 ¥0.5/M、输出 ¥8/M), shown as 本会话 ¥x.xx . This is an estimate , not billing authority. - Click to refresh the balance. - Custom baseURL support for gateway/proxy deployments. How it works / 工作原理 Half Mechanism Host ( index.js ) Registers a webServer exact route /api/billing-balance ; resolves DEEPSEEK API KEY via the credentials seam at request time; calls the balance endpoint with the global fetch (real Node environment). The key is never written to files or logs. Client ( client.js ) A window. ModuleLoader .load bundle registering an entry in the conversation.composer.dock slot (order 1, beside the shipped sta…
在 GitHub 查看完整 README →