@sligqoer/dsh-usage-stats
提供Token用量统计与配额面板 适合需要监控Token消耗、过滤历史用量和查看配额的桌面端用户。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Jockjrop/dsh-usage-stats说明文档
阅读完整 README ↗Usage
用量 shows how much you use and when. Hover a chart or heatmap cell for its breakdown. The overview cards retain their today/lifetime meanings when you change a historical filter.
配额 shows data returned by connected platforms. Configured balances may show 未查询 until their first query; available cards depend on credentials and account permissions.
控制 lets you change display and refresh settings:
| Setting | Default |
|---|---|
| Automatic quota refresh | Off |
| Refresh interval | 1 hour; also supports 10 minutes, 5 hours, or daily |
| Model details | On |
| Advanced model selector | Off |
Enabling automatic queries asks you to acknowledge possible query costs. The schedule continues while the settings page is closed. Opening the quota page normally reads cached results.
Supported providers and credentials
Built-in readers cover Claude, DeepSeek, StepFun, Codex, GitHub Copilot, OpenRouter, Moonshot China/global, Kimi Coding, MiniMax China/global, Z.AI, GLM Coding, Alibaba Cloud Token Plan China, xAI, and OpenCode Go.
The corresponding provider must be configured in DSH. Supported OAuth readers use existing unexpired grants; this plugin does not refresh or modify logins.
| Optional reader | Host credential references |
|---|---|
| OpenRouter account credits | OPENROUTER_MANAGEMENT_API_KEY |
| xAI prepaid balance | XAI_MANAGEMENT_API_KEY, XAI_TEAM_ID |
| Alibaba Cloud Token Plan China | ALIBABA_CLOUD_ACCESS_KEY_ID, ALIBABA_CLOUD_ACCESS_KEY_SECRET; optional ALIBABA_CLOUD_SECURITY_TOKEN |
OpenCode Go uses only its own configured DSH credential. Zen has no built-in wallet balance reader, but supports custom queries. Alibaba Cloud's international Token Plan is not queried.
WorkBuddy and WorkBuddy AI require the optional dsh-workbuddy-connect adapter. Their quotas are cached and refreshed separately.
Set up a custom quota query
- Open 控制 → 配额查询 and select an existing provider.
- Enter the query URL and response mapping.
- Click 测试 and check the parsed result.
- Confirm the query to show it in 配额.
For an endpoint returning { "data": { "balance": 12.34 } }:
{
"url": "https://api.example.com/balance",
"method": "GET",
"auth": "provider",
"headers": { "accept": "application/json" },
"response": {
"metrics": [
{
"label": "Account balance",
"kind": "amount",
"remaining": "data.balance",
"currency": "USD"
}
]
}
}
Replace the example URL with the provider's working endpoint. auth: "provider" uses its configured DSH credential; authenticated URLs must share the configured or official quota origin.
Templates support GET/POST, JSON bodies, amount/window metrics, and paths such as data.items[0].balance. Window metrics accept percentage fields or total with remaining/used; response.rows selects an array. Use auth: "none" for unauthenticated endpoints.
Editing invalidates the test; successful tests expire after 15 minutes. A confirmed query overrides the built-in reader for that provider. Removing it restores the built-in reader.