Introduction

DSH’s plugin architecture breaks down common capabilities into loadable plugins. For developers using multiple AI platforms simultaneously, balance and usage are often scattered across different consoles. dsh-api-balance is a DSH Web plugin maintained by Badegg404. It displays the account balance and usage of multiple AI platforms in a floating pill on the session title bar, split into two tabs: Balance and Usage. Below, we introduce its positioning, core features, installation command, and typical usage.

What is it

dsh-api-balance is a DSH Web plugin: a floating pill in the session title bar that displays account balance and usage for multiple AI platforms (with a dual tab interface for Balance / Usage).

It is maintained by Badegg404 and is licensed under MIT. The GitHub repository is:

https://github.com/Badegg404/dsh-api-balance

Core Features

  • Multi-provider: A single plugin queries multiple AI platforms and allows switching providers in the UI.
  • Dual Tabs: Balance displays account balance; Usage displays 30-day costs or token quotas.
  • Persistence: provider / API key / extra parameters are saved in the DSH credentials store (~/.dsh/.credentials.yaml, mode 0600) and persist after restart.
  • Real-time Refresh: Auto-polls every 30s and supports manual refresh.
  • Security: Host routes only accept loopback requests; API keys are not sent to the frontend or written to logs.
  • Theme-aware: Uses DSH theme tokens and follows light/dark modes.
  • Extensible: Add entries in PROVIDERS (or BALANCE_PROVIDERS / USAGE_PROVIDERS) on the host side according to the README, and the UI automatically renders the corresponding form.

Installation and Enablement

The installation command is as follows:

dsh plugin --profile web add https://github.com/Badegg404/dsh-api-balance.git

This command is used for the web profile. After adding the plugin to DSH, you can see the entry in the title bar when opening a session.

Typical Usage

  1. After opening a session, a floating pill appears in the title bar, located to the left of the Session log button.
  2. In the Balance tab, select a balance provider, paste the API key (AGICTO also requires an account UUID), and save. Balance is displayed and auto-refreshes every 30s.
  3. In the Usage tab, select a usage provider (e.g., OpenAI), paste the API key, and save. It displays the last 30 days’ costs (or Zhipu’s token quota) and auto-refreshes similarly.
  4. You can manually Refresh, Clear, or re-select a provider in the UI.

Applicable Scenarios and Notes

Suitable for developers who frequently call multiple AI providers and wish to view account balances and usage within a single DSH session interface.

Notes before use:

  • The plugin runs with the current DSH process permissions; check the source code and license before installing.
  • Provider endpoints may change upstream; if a provider fails to parse, consult the official documentation.
  • AGICTO requires an extra parameter: account UUID.
  • Credentials are saved in ~/.dsh/.credentials.yaml (mode 0600).
  • Host routes only accept loopback requests; API keys are not sent to the frontend or written to logs.

Conclusion

dsh-api-balance consolidates multi-platform balance and usage viewing into the DSH session title bar, reducing the cost of switching between multiple consoles.

GitHub: https://github.com/Badegg404/dsh-api-balance

Related Directory Page (Community site, link from plugin clues): https://www.skillhub.cn/plugins/Badegg404/dsh-api-balance