Passer au contenu principal
L

dsh-usage-monitor

lcthe/dsh-usage-monitor

DSH Usage Monitor: auto-query provider credit balances and time-window limits from configured API keys, with input capsule and custom provider support.

Installer

dsh plugin --profile web add github:lcthe/dsh-usage-monitor

README

dsh-usage-monitor

DSH Usage Monitor — View API credit balance and usage status across all configured LLM providers.

English | 简体中文

🎯 Overview

A DSH plugin that adds a Usage page to the settings UI. It automatically reads your configured API keys from the DSH credential system and queries each provider's balance API, displaying the results in a clean card-based layout.

✨ Features

  • Auto-detect configured providers — reads API keys from DSH credentials, no manual input needed
  • Card-based UI — DSH unified card style, responsive grid layout
  • Multiple display modes — currency (¥/$), token count, time-window progress bars
  • Custom providers — add your own providers with test connection
  • Input capsule — balance in composer toolbar, refreshes on provider switch, message send, or click
  • Console links — one-click access to provider dashboards
  • Filtering — filter by All / Configured / Balance Supported
  • i18n — Chinese and English

Screenshots

Usage Monitor

📐 Requirements

Requires a DSH deployment with a browser client, including the Desktop or Web version with Web UI.

📦 Installation

pnpm add @lcthe/dsh-usage-monitor

Add the plugin to your cordis.yml at the same include level as other bundles:

- insert:
    - id: dsh-usage-monitor
      name: '@lcthe/dsh-usage-monitor'

Start the DSH Web client:

pnpm dsh web

After DSH starts, open Settings → Usage to view your provider balances.

🔑 Provider Support

已稳定测试: DeepSeek、OpenCode Go。其他供应商的余额查询接口未经完整测试,欢迎反馈。

余额查询支持

供应商余额接口计费模式显示方式控制台状态
DeepSeekGET /user/balance按量付费¥ 余额platform.deepseek.com✅ 已验证
OpenCode GoGET /v1/usage订阅制5h/周/月 进度条opencode.ai/workspace/go✅ 已验证
Moonshot AIGET /v1/users/me/balance按量付费¥ 余额platform.moonshot.cn⚠️ 未测试
Moonshot AI CNGET /v1/users/me/balance按量付费¥ 余额platform.moonshot.cn⚠️ 未测试
OpenRouterGET /api/v1/credits按量付费$ 余额openrouter.ai⚠️ 需 Management Key
Fireworks AIGET /v1/accounts/-/billingUsage后付费$ 已用费用fireworks.ai⚠️ 未测试
Z.AI(智谱)GET /user/rights按量付费token 余量open.bigmodel.cn⚠️ 未测试
Z.AI CNGET /user/rights按量付费token 余量open.bigmodel.cn⚠️ 未测试

不支持余额查询

以下供应商暂无公开的余额查询 API,显示控制台链接供手动查看:

供应商控制台
OpenAIplatform.openai.com
Anthropicconsole.anthropic.com
Google Geminiaistudio.google.com
Groqconsole.groq.com
Mistralconsole.mistral.ai
xAIconsole.x.ai
Together AIapi.together.ai
Cerebrascloud.cerebras.ai
NVIDIAbuild.nvidia.com
Hugging Facehuggingface.co
Qwen(通义千问)dashscope.console.aliyun.com
Xiaomi(小米)platform.xiaomimimo.com
Kimi For Codingkimi.moonshot.cn
Ant Ling(蚂蚁灵)ant-ling.com
OpenCode Zenopencode.ai/workspace

🤝 Contributing

Issues and PRs are welcome!

📄 License

MIT

Plugins associés