Chi-hong22/dsh-plan-spend ↗★ 0
@chi-hong22/dsh-plan-spend
展示官方余额及OpenCode Go配额的用量弹窗 适合需要监控DeepSeek官方和OpenCode Go API额度消耗的用户。
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Chi-hong22/dsh-plan-spend說明文件
閱讀完整 README ↗Configuration
The plugin has no config. It decides which providers to show from whether their
credential is configured; the reference names live in the ADAPTERS table in
index.js:
| Provider | Credential ref (POSIX environment name) |
|---|---|
| DeepSeek official | DEEPSEEK_API_KEY |
| OpenCode Go | OPENCODEGO_API_KEY |
Credentials resolve through ctx.credentials.resolve(); the source precedence
is documented by @deepseek-ai/dsh-credentials-local (launch environment →
stored file → project .env → harness home .env). An unconfigured provider
issues no request and renders as "no credential configured; skipped".
The API-key row is the fallback. The DeepSeek card is normally read in this
half from the signed-in DeepSeek account: ctx.deepseekAccount.resolveToken
hands out the stored grant for the configured inference origin
(https://api.deepseek.com), and that token goes to the same /user/balance
endpoint as x-dsh-auth-token. No API key is needed, and the grant never
reaches the browser. When the account cannot answer (signed out, no account
provider in this composition, or the query failed) the API-key card stands in
and names its own route; a failed account query is reported on that fallback
card, so "signed out" and "the query broke" stay distinguishable.
The account service's own balance query is deliberately not used: it goes to
platform.deepseek.com, whose WAF answers non-browser clients with HTTP 429,
so it reports a failed balance instead of a number.
A failed or missing API-key read also reports the effective credential's
source layer and whether this surface could write it
(ctx.credentials.describe), because "I saved a key and it still unauthorised"
is almost always a read-only launch-environment value winning over the stored
one.
Adding a provider = one row in ADAPTERS plus one reader function.