glangzh
dsh-session-cost
为 dsh(DeepSeek Harness)网页端提供会话花费 + 账户余额查询
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 16, 2026
- Updated
- Aug 16, 2026
Introduction
dsh-session-cost
为 dsh(DeepSeek Harness)网页端提供会话花费 + 账户余额查询。会话头部右上角(Session log 旁)一个图标按钮,点击弹窗显示当前会话的 DeepSeek 花费明细与账户余额。
功能
- 会话花费:展示输入(未缓存+缓存写)/ 输入(缓存命中)/ 输出 + 合计
- 仅统计 DeepSeek 模型,按每次调用实际模型计价
- 账户余额:DeepSeek 开放平台余额查询
安装
通过 dsh plugin 安装到任意 profile:
# git 安装(推荐,纯 JS 无构建,可直接用;建议锁定 commit)
dsh plugin --profile web add github:glangzh/dsh-session-cost
# 本地目录(开发调试)
dsh plugin --profile web add ./dsh-session-cost
重启 dsh web(或所在应用)生效;更新用 dsh plugin --profile web update dsh-session-cost,卸载用 dsh plugin --profile web remove dsh-session-cost。
注:若插件含 TypeScript 构建步骤,git 安装需要
prepare脚本,并在 profile 的pnpm-workspace.yaml中对该包授权构建。
配置
- DeepSeek API Key:环境变量
DEEPSEEK_API_KEY,或~/.dsh/.credentials.yaml中的DEEPSEEK_API_KEY条目 - 价目表覆盖:
DSH_PRICES_FILE指向自定义 JSON - 价格缓存:
~/.dsh/session-cost/prices.json
免责
花费为近似口径(token 桶 × 表价),精确账单以 DeepSeek 官方为准;峰谷时段与价格以官方公告为准。