haifeiWu/dsh-deepseek-usage

插件 ⭐ 1 web-ui

DSH插件:在DSH Web界面中实时显示DeepSeek Token使用量、预估成本及账户余额

catalog 简介:DSH plugin: real-time DeepSeek token usage, estimated cost and account balance in the DSH Web UI

安装

3. 在 profile 目录执行 `pnpm install`,重启 `dsh web`。

## 配置

| 键 | 默认 | 说明 |
| --- | --- | --- |
| `balanceUrl` | `https://api.deepseek.com/user/balance` | 余额接口地址 |
| `refreshIntervalMs` | `60000` | 余额轮询间隔(毫秒) |
| `apiKeyRef` | `DEEPSEEK_API_KEY` | 凭据引用(`~/.dsh/.credentials.yaml` / 环境变量) |
| `prices` | 官方价(见下) | 按模型 key 的计价表(每百万 tokens 人民币) |
| `defaultPriceKey` | `deepseek-v4-flash` | 未匹配模型的兜底计价 key |
| `storePath` | `$DSH_HOME/deepseek-usage/usage-store.json` | 全局用量存储文件 |
| `platformTokenRef` | `DEEPSEEK_PLATFORM_TOKEN` | 平台 session token 凭据引用;配置后「今日 / 近 7 天」显示官方口径金额 |

默认计价(DeepSeek 官方 2026-08 现行价,每百万 tokens):

| 模型 | 输入(缓存命中) | 输入(未命中) | 输出 |
| --- | --- | --- | --- |
| deepseek-v4-flash | ¥0.02 | ¥1 | ¥2 |
| deepseek-v4-pro | ¥0.025 | ¥3 | ¥6 |

### 官方口径(可选):获取 DEEPSEEK_PLATFORM_TOKEN

官方没有公开的用量查询 API,但平台控制台(platform.deepseek.com)登录后有一个内部用量接口,可用于查询按日消耗。取 token:

1. 浏览器登录 https://platform.deepseek.com
2. 打开 DevTools → Console,执行:`JSON.parse(localStorage.getItem('userToken')).value`
3. 把输出的字符串存为凭据(`~/.dsh/.credentials.yaml` 或环境变量):

haifeiWu/dsh-deepseek-usage 加入你的 DSH 配置(web profile)即可启用。

README

展开完整 README 收起

README 内容为空。