DeepSeek Harness plugin

dsh-model-balance

Multi-provider account balance display for the DeepSeek Harness Web GUI. Queries real billing APIs (DeepSeek, StepFun, Kimi Coding, OpenRouter, MiniMax, xAI) and shows balance/quota in front of the

Jump to install

Source facts

Repository
nabin-qq273274877/dsh-model-balance
Latest update
Aug 20, 2026
Category
Models & Providers
GitHub stars
3
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/nabin-qq273274877/dsh-model-balance
Plugin: dsh-model-balance
Author: nabin-qq273274877

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.en.mdSource · read only
README language

dsh-model-balance

![npm](https://www.npmjs.com/package/dsh-model-balance) ![License: MIT](LICENSE)

中文 | English

Multi-provider real account balance display for the DeepSeek Harness Web GUI.

Shows a balance pill in front of the model selector in the composer. Switch models → instantly see that provider's balance. Every usage change triggers a refresh.

Currently Supported Providers

ProviderAPI EndpointDataStatus
DeepSeekGET /user/balanceAccount balance (¥)✅ Official API
StepFunGET /v1/accountsAccount balance (¥)✅ Official API
Kimi CodingGET /v1/usagesQuota (7-day + 5-hour)✅ Official API
OpenRouterGET /api/v1/auth/keyCredit balance ($)✅ Official API
MiniMaxGET /v1/token_plan/remainsRemaining quota✅ Official API
xAI / GrokGET /v1/dashboard/billing/credit_grantsCredit balance ($)✅ Official API
Qwen Token PlanBailian consoleLogin to view🔗 Login required
Xiaomi MiMoXiaomi platform consoleLogin to view🔗 Login required
Mistral, Groq, Cohere, …⚠️ Not supported

> Adding a new provider? Two ways: > 1. Config file (recommended): Edit providers.json in plugin directory or create ~/.dsh/model-balance-providers.json > 2. Submit PR: See [src/host/strategies.ts](src/host/strategies.ts) — add a parser + strategy entry

Display States

The pill renders four states depending on the provider type:

Currency balance

<p align="center"><img src="docs/images/currency.png" alt="Currency balance" width="720"></p>

DeepSeek, StepFun, OpenRouter, xAI, etc. show the account balance directly (click to refresh).

Quota percentage

<p align="center"><img src="docs/images/quota.png" alt="Quota percentage" width="720"></p>

Kimi Coding shows both the 7-day weekly quota and the 5-hour rate-limit as remaining percentages (hover for request counts and reset time).

Login to view

<p align="center"><img src="docs/images/login-required.png" alt="Login to view" width="720"></p>

Qwen (Bailian Token Plan) and Xiaomi MiMo have no API balance endpoint — clicking opens the console in a new page.

Not supported

<p align="center"><img src="docs/images/unqueryable.png" alt="Not supported" width="720"></p>

Providers with neither an API endpoint nor a public console entry.

How It Works

┌─────────┐    GET /model-balance/query    ┌──────────┐   Bearer API key    ┌──────────────┐
│  Browser │ ──────────────────────────────→│ DSH Host │ ──────────────────→│ Provider API │
│  (pill)  │←──────────────────────────────│  (route) │←──────────────────│  (real data) │
└─────────┘    JSON envelope               └──────────┘   balance/quota    └──────────────┘
  • Browser: renders the pill, triggers queries on model switch / turn end / periodic poll / click
  • Host route (/model-balance/query): resolves the provider's credential from DSH Credentials, queries the billing API, caches results (60s success / 15s error)
  • No credentials leak: API keys never reach the browser

Install

# Via npm
npx @deepseek-ai/dsh plugin --profile web add dsh-model-balance

# From GitHub
npx @deepseek-ai/dsh plugin --profile web add github:nabin-qq273274877/dsh-model-balance

# Local development (link)
npx @deepseek-ai/dsh plugin --profile web add link:/path/to/dsh-model-balance

Or copy this prompt to AI:

Please install the dsh-model-balance plugin for me. Repository: https://github.com/nabin-qq273274877/dsh-model-balance
Follow the README instructions for installation and configuration.

Then restart dsh web and refresh.

Uninstall

npx @deepseek-ai/dsh plugin --profile web remove dsh-model-balance

Custom Providers

The plugin includes a providers.json with all supported providers. You can:

1. Edit the providers.json in the plugin directory directly 2. Or create ~/.dsh/model-balance-providers.json (higher priority, overrides same-name providers)

Config file format:

{
  "providers": {
    "your-provider": {
      "name": "Display Name",
      "baseURL": "https://api.example.com",
      "endpoint": "/v1/balance",
      "keyEnv": "YOUR_API_KEY",
      "response": {
        "type": "currency",
        "currency": "USD",
        "balancePath": "data.balance"
      }
    }
  }
}

Field reference:

FieldRequiredDescription
nameNoDisplay name
baseURLYesAPI base URL
endpointYesBalance endpoint path
keyEnvYesEnvironment variable name for the API key
response.typeYescurrency (balance) or quota (request count)
response.currencyNoCurrency code, default "CNY"
response.balancePathYes*JSON path, e.g. "data.balance"
response.limitPathYes*JSON path for quota limit
response.usedPathYes*JSON path for used quota
response.remainingPathYes*JSON path for remaining quota
aliasesNoList of alias provider IDs

Restart dsh web after modifying the config.

Refresh Strategy

TriggerBypass CacheDescription
Model switchNoQuery new provider's balance (host cache OK)
Turn endYesUsage just changed, force fresh data
Periodic pollNoEvery 2 minutes while tab is visible
Click pillYesManual force-refresh

Development

git clone https://github.com/nabin-qq273274877/dsh-model-balance.git
cd dsh-model-balance
pnpm install
pnpm run build
pnpm test

# Link into your DSH profile for live testing
npx @deepseek-ai/dsh plugin --profile web add link:$(pwd)

Architecture

src/
├── types.ts              # Shared type definitions
├── host/
│   ├── index.ts          # Host plugin: route registration + caching
│   └── strategies.ts     # Strategy registry + URL matching + parsers
└── client/
    └── index.ts          # Client plugin: BalancePill component + locales

scripts/
└── build.ts              # esbuild: host ESM + client factory bundle

docs/
└── images/               # README screenshots

test/
└── strategies.test.ts    # Unit tests for matching + parsing

License

[MIT](LICENSE)