dsh-ai-quota
Manifest validDeepSeek Harness plugin: query AI subscription quotas & balances (Codex, Kimi, DeepSeek, 302.AI, OpenCode Go) as a model tool and a Settings page
dsh-ai-quota
A DeepSeek Harness plugin that shows your AI subscription quotas & balances — Codex, Kimi, GLM Coding Plan, DeepSeek, 302.AI, OpenCode Go — in one place.
English · 中文
Preview

Settings page: per-window usage bars (Codex / Kimi / GLM Coding Plan / OpenCode Go) and plain balances (DeepSeek, 302.AI), with manual refresh and a freshness line in relative time; the gear button opens the embedded visibility settings, one switch per provider.
Features
- Model tool
query_ai_quota— ask any agent session to check your quota; returns a human-readable summary. - Settings page — an "AI Quota" section with per-window usage bars and balances, plus manual refresh.
- Per-provider visibility — the gear button in the section header opens a second level inside the same settings page: one switch per provider. A provider with no key or login state keeps its row, its switch stays inert, and the row names what is missing (which key, login, or CLI); a switch you can flip is the detection signal, so there is no separate "detected" badge. Everything detected is on by default, so a key added later appears on its own. The choice applies to the list and to the composer chip, and is stored in the browser (
localStorage), so flipping one is instant — no host round-trip, no plugin reload. Thequery_ai_quotatool always returns every provider. - Composer chip — a one-line quota indicator that follows the selected provider route (never the model id: the same model can be served by several routes with independent quotas), on both the new-chat page and in sessions.
- Auto-refresh — the host re-queries all providers every
refreshIntervalMs(default 2 min;0disables) and serves a warm cache, so every surface reads instantly. An open conversation additionally re-reads its provider's quota every 60 s (silently, without a loading flicker), so a session left running for a while never keeps the balance it loaded with; a hidden tab is skipped and caught up when it becomes visible again. - Unified format — providers are normalized to
subscriptionwindows orbalanceentries; one provider failing never affects the others. - Skin-aware palette — every readout color is a CSS variable: with the dsh-miku-skin Hatsune skin loaded the chip and usage bars turn soft Miku teal, and without it they keep the shipped emerald/amber/red severity colors. A bar that reaches amber or red also tints its own hairline to match, so the whole meter reads as one state; a healthy bar keeps the quiet neutral outline.
- No secrets in output — API keys and tokens never appear in tool output or logs.
Install
dsh plugin --profile web add github:Carrick-K7/dsh-ai-quota
The bundled cordis.patch.yml declaration makes dsh plugin append the plugin row to dsh.profile.bundles automatically. Restart dsh web afterwards (pnpm must be on PATH).
Configuration
All keys optional, defaults shown.
| Key | Default | Meaning |
|---|---|---|
timeoutMs | 15000 | Per-provider query timeout (ms) |
refreshIntervalMs | 120000 | Auto-refresh interval (ms); 0 = off |
codexCli | codex | codex CLI command or absolute path |
deepseekApiKeyEnv | DEEPSEEK_API_KEY | DSH credential ref (fallback: same-named env var) |
opencodeGoApiKeyEnv | OPENCODE_GO_API_KEY | DSH credential ref (fallback: same-named env var) |
ai302ApiKeyEnv | AI_302_API_KEY | DSH credential ref (fallback: same-named env var) |
glmApiKeyEnv | ZAI_CODING_CN_API_KEY | DSH credential ref for the GLM Coding Plan key (falls back to ZAI_CODING_API_KEY, then GLM_CODING_API_KEY) |
deepseekBaseUrl | https://api.deepseek.com | DeepSeek API base URL |
opencodeBaseUrl | https://opencode.ai/zen/go/v1/usage | OpenCode Go usage endpoint |
ai302BaseUrl | https://api.302.ai | 302.AI API base URL |
glmBaseUrl | https://open.bigmodel.cn | GLM Coding Plan API host; only the origin is used, so a coding base like …/api/coding/paas/v4 works. International accounts: https://api.z.ai |
kimiBaseUrl | https://api.kimi.com/coding/v1 | Kimi usage endpoint base (appends /usages) |
kimiOauthHost | https://auth.kimi.com | Kimi OAuth refresh endpoint (appends /api/oauth/token) |
kimiClientId | Kimi Code CLI's public client id | OAuth client_id (usually unchanged) |
Composer chip routing
The chip reads the provider route of the current model selection (e.g. opencode-go-carrick, kimi-coding, deepseek-official, openai-codex) and never the model id — kimi-k3 on an OpenCode Go route is an OpenCode Go quota, not a Kimi one. A route is recognized when its id (or, for an opaque alias, its provider display name) contains one of 302, opencode, codex, kimi/moonshot, deepseek, zai/zhipu/bigmodel/glm. Any other route shows no chip rather than another account's balance.
The chip then re-reads that provider every 60 s while it is mounted, reading the host's warm cache (so no extra upstream calls). If the host snapshot itself is older than 10 min — i.e. the host auto-refresh is off or stalled — the poll escalates to a real query, throttled to once per 10 min per provider.
Credentials
- DeepSeek / 302.AI / OpenCode Go: key resolved through the DSH credentials seam first —
apiKeyEnvis a credential ref (defaultsDEEPSEEK_API_KEY/AI_302_API_KEY/OPENCODE_GO_API_KEY), so a key stored in DSH (e.g.$DSH_HOME/.credentials.yaml) wins; a same-named process env var is the fallback for standalone deployments. OpenCode Go also falls back to theopencode-goentry in~/.local/share/opencode/auth.json. - GLM Coding Plan: key resolved through the same credentials seam; the default ref is
ZAI_CODING_CN_API_KEY, withZAI_CODING_API_KEYandGLM_CODING_API_KEYtried next, so either region's key name works. PointglmBaseUrlathttps://api.z.aifor an international coding plan. - Codex / Kimi: no keys — the local CLI login state is reused (codex CLI on PATH; Kimi Code CLI's OAuth session, auto-refreshed when expired,
kimi loginagain if it is gone).
Data sources
| Provider | Source |
|---|---|
| Codex | Local codex app-server --stdio JSON-RPC (account/rateLimits/read) — 5h / 7d windows |
| Kimi | GET {kimiBaseUrl}/usages (Kimi Code CLI's OAuth login state) |
| GLM Coding Plan | GET {glmBaseUrl}/api/monitor/usage/quota/limit (bearer key) — 5h credit cycle / weekly quota / monthly MCP budget |
| DeepSeek | GET {deepseekBaseUrl}/user/balance (bearer key) |
| 302.AI | GET {ai302BaseUrl}/dashboard/balance (bearer key) |
| OpenCode Go | GET {opencodeBaseUrl} (bearer key) |
License
Comments
Loading…
From the same category
by ccch1mneyyy
DSH 官方公众号收录的 TUI 补位插件:Claude Code 风,鲸鱼顶栏/实时状态/流式思考/双击 Esc 回滚/上下文进度+TPS。npm 一键装。 DSH official WeChat featured TUI plugin — Claude Code style: whale bar, live status, streaming thoughts, double-Esc rol
★ 4k
↓ 16.5k/wk
MIT
TypeScript
Oct 5, 2026
dsh plugin --profile terminal add @deepseek-harness-tui/dsh-tuiby strukto-ai
The World's First Virtual Terminal for AI Agents
★ 3.7k
↓ 344/wk
Apache-2.0
TypeScript
Oct 5, 2026
dsh plugin --profile agent add @struktoai/mirage-dshby bowenliang123
The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,
★ 1.8k
↓ 38.5k/wk
Apache-2.0
TypeScript
Oct 4, 2026
dsh plugin --profile web add dsh-contextby huiliyi37
官方 DeepSeek Harness 的交互式终端 UI 插件:自研 ANSI 极简交互渲染、流式 Markdown/工具卡、16+ 主题、slash 命令与选择器、输入历史与本地偏好持久化、LSP 诊断、memory记忆,很丝滑的开发体验。
★ 282
↓ 560/wk
Apache-2.0
TypeScript
Sep 30, 2026
dsh plugin --profile terminal add @huiliyi37/dsh-tianshu-tuiby Hilbert-beinghappy
面向 DeepSeek Harness 的 Claude Code 风格终端界面,支持 Windows、macOS 与 Linux,兼容透明终端、VS Code 主题和自定义配色。
★ 197
↓ 108/wk
MIT
TypeScript
Oct 1, 2026
dsh plugin --profile web add seekttyby T-Auto
deepseek-harness Plugin Access and Implementation Standards / deepseek-harness交互生态插件规范与实施标准
★ 81
MIT
JavaScript
Oct 3, 2026