YZz-S/dsh-token-cost-meter ↗★ 1
dsh-token-cost-meter
DeepSeek Harness (dsh) 会话费用插件:显示当前会话累计 token 消耗与估算费用,价格从 DeepSeek 官方价格页动态获取。
AI 분석
核心用途是实时监控当前对话的 API 消费。适合需要控制 API 成本、直观了解单次会话花费的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YZz-S/dsh-token-cost-meterUsage
Method 1: dynamic Cordis plugin (temporary)
- Open DSH Web and enter a session;
- Ask the assistant to call
cordis_define, submittinghost.jsfull text ascode.hostandclient.jsfull text ascode.client; cordis_runthe returnedpluginId/packageId;- Approve on the Run card (double ✓ recommended to skip approval for future updates);
- Refresh the page; the cost stats line appears below the input box.
A dynamic plugin lives as long as the current DSH process: after a DSH restart you must define + run it again.
Method 2: install as a regular plugin (persistent)
That's the "Installation (dsh.bundle)" section above — after dsh plugin add it loads automatically at DSH startup.
使用方法
方式一:动态 Cordis 插件(临时运行)
- 打开 DSH Web,进入会话;
- 让助手调用
cordis_define,将host.js全文作为code.host、client.js全文作为code.client提交; cordis_run运行返回的pluginId/packageId;- 在 Run 卡片上批准(建议勾选双 ✓,后续版本更新免审批);
- 刷新页面,输入框下方出现费用读数。
动态插件的生命周期与当前 DSH 进程相同:重启 DSH 后需重新 define + run。
方式二:正式插件(常驻)
即上方「安装(dsh.bundle)」一节,dsh plugin add 后随 DSH 启动自动加载。