Introduction

DeepSeek Harness (DSH) is a tool for agent development. In real-world development, developers often need to check the quota status of the current provider when switching models, such as the subscription limits for OpenCode Go or the prepaid balance for DeepSeek, and want to estimate consumption based on local token usage. The dsh-opencode-go-quota plugin resolves this with a persistent capsule in the bottom-right corner, allowing the status to be viewed without navigating to another page.

Core Features

A static capsule labeled “Balance” is always displayed in the bottom-right corner. When clicked to expand, it immediately fetches and displays the limits/balance for the currently selected model provider. The plugin supports two types of data:
1. plan providers (e.g., OpenCode Go): displays limits and progress.
2. tokens providers (e.g., deepseek-official): displays balance and a consumption estimate.

The consumption amount is estimated by pricing table × local token usage. The card is collapsed by default, and each expansion triggers a new request. When any plan window reaches rate-limited, the card displays a red warning: “Limit reached”.

Installation and Enablement

Install the source code from GitHub:

git clone https://github.com/zer0zio-stack/dsh-opencode-go-quota.git
dsh plugin --profile web add .\dsh-opencode-go-quota

Local development:

dsh plugin --profile web add .

After installation, restart dsh web (the plugin manifest is read at startup; a running instance will not hot-reload new plugins).

Configuration and Providers

During installation, cordis.patch.yml inserts a line with a built-in adapter. The provider configuration is as follows:

Provider kind Data source Credentials
opencode-go plan https://opencode.ai/zen/go/v1/usage OPENCODE_GO_API_KEY
deepseek tokens https://api.deepseek.com/user/balance DEEPSEEK_API_KEY
deepseek-official tokens https://api.deepseek.com/user/balance DEEPSEEK_API_KEY

DeepSeek V4 pricing is built into the code based on the user-provided deepseek_markdown_20260815_c4af7f.md and supports peak/idle period differentiation. To override the pricing, you can overwrite the entire line configuration in the profile’s cordis.patch.yml using id: opencode-go-quota and rewrite providers.<id>.pricing.

Working Principles and Limitations

This only applies to the web profile; in headless mode, that line remains pending due to the missing webServer.

Limits and balances are raw API values. The consumption amount is an estimate calculated as pricing table × local token usage, excluding discounts, taxes, cross-currency differences, and session logs deleted before plugin startup. Token usage is bucketed by the Host’s local timezone; peak/idle periods are also determined by the Host’s local hour when the event occurred.

API keys are resolved only within the current process. redirect: 'error' prevents following redirects. Credentials are not forwarded to other origins and are never sent to the browser.