During development or everyday use with DeepSeek Harness (DSH), managing API keys and monitoring balances is a common task. If you need to quickly check the balance in the Web UI, manually logging into the web page or querying via the command line is inefficient. The DSH plugin mechanism allows extending the functionality of the Web UI.

dsh-plugin-api-quota is a DSH Web UI plugin. Maintained by ganfne123 and categorized as a “networking tool,” its core purpose is to add an API balance entry at the bottom of the sidebar in the Web interface, used to query the balance of DeepSeek API keys.

Core Features

The plugin primarily provides the following features:

  1. Sidebar Integration: Adds an “API Quota” entry at the bottom of the Web sidebar (next to Settings).
  2. Balance Query: Queries the official DeepSeek balance endpoint (GET /user/balance).
  3. Information Display: The panel displays total balance, obtained balance, recharged balance, currency, and availability status.
  4. Interactive Refresh: Shows the query time and provides a refresh button to update the data.
  5. Security Design: The API key is not sent to the browser; it is handled through a same-origin route on the plugin host (/api-quota/balance).
  6. Host-Side Processing: The host resolves the key via ctx.credentials and calls api.deepseek.com.
  7. Configurability: Supports adjusting behavior via the configuration items apiKeyEnv, baseURL, and balancePath.

Installation and Activation

Installing and activating the plugin requires manual operation, consisting of three steps: build, register, and link.

  1. Run the build command in the root directory of the plugin repository:
    npm install && npm run build
  1. Register the plugin in the configuration file ~/.dsh/profiles/web/cordis.patch.yml:
    - insert:
      - id: plugin-api-quota
        name: dsh-plugin-api-quota
  1. Create a symbolic link from the plugin directory to the Web profile’s node_modules:
    ln -s "$PWD" ~/.dsh/profiles/web/node_modules/dsh-plugin-api-quota

Usage

After installation and restarting dsh web, a new “API Quota” entry appears at the bottom of the sidebar. Click the entry, and the panel displays the balance information. To refresh the data, click the refresh button.

Use Cases and Notes

This plugin is suitable for users who need to quickly verify DeepSeek API balances in the Web interface. The plugin runs with the permissions of the host process, so it is recommended to review the source code and license before installing. The plugin uses the MIT license.

Summary

With this plugin, you can integrate balance checking into the DSH workflow and reduce the frequency of switching windows.

Plugin catalog: https://www.skillhub.cn/plugins/ganfne123/dsh-plugin-api-quota
Source code: https://github.com/ganfne123/dsh-plugin-api-quota