Jockjrop/dsh-usage-stats ↗★ 1

@sligqoer/dsh-usage-stats

提供Token用量统计与配额面板 适合需要监控Token消耗、过滤历史用量和查看配额的桌面端用户。

包名
@sligqoer/dsh-usage-stats
兼容性
待验证
版本
0.1.2
许可证
Apache-2.0
最近更新
2026年10月1日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Jockjrop/dsh-usage-stats

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:

SettingDefault
Automatic quota refreshOff
Refresh interval1 hour; also supports 10 minutes, 5 hours, or daily
Model detailsOn
Advanced model selectorOff

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 readerHost credential references
OpenRouter account creditsOPENROUTER_MANAGEMENT_API_KEY
xAI prepaid balanceXAI_MANAGEMENT_API_KEY, XAI_TEAM_ID
Alibaba Cloud Token Plan ChinaALIBABA_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

  1. Open 控制 → 配额查询 and select an existing provider.
  2. Enter the query URL and response mapping.
  3. Click 测试 and check the parsed result.
  4. 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.