Back to home@Carrick-K7

dsh-ai-quota

DeepSeek Harness plugin: AI subscription quotas & balances (Codex, Kimi, DeepSeek, OpenCode Go) — model tool, Settings page, composer chip

Stars
1
Language
JavaScript
Created
Aug 24, 2026
Updated
Aug 24, 2026
GitHub repo

Introduction

dsh-ai-quota

A DeepSeek Harness plugin that shows your AI subscription quotas & balances — Codex, Kimi, DeepSeek, OpenCode Go — in one place.

English · 中文

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.
  • Composer chip — a one-line quota indicator that follows the selected model (toggleable in Settings).
  • Auto-refresh — the host re-queries all providers every refreshIntervalMs (default 2 min; 0 disables) and serves a warm cache, so every surface reads instantly.
  • Unified format — providers are normalized to subscription windows or balance entries; one provider failing never affects the others.
  • 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.

KeyDefaultMeaning
timeoutMs15000Per-provider query timeout (ms)
refreshIntervalMs120000Auto-refresh interval (ms); 0 = off
codexClicodexcodex CLI command or absolute path
deepseekApiKeyEnvDEEPSEEK_API_KEYEnv var name for the DeepSeek API key
opencodeGoApiKeyEnvOPENCODE_GO_API_KEYEnv var name for the OpenCode Go key
deepseekBaseUrlhttps://api.deepseek.comDeepSeek API base URL
opencodeBaseUrlhttps://opencode.ai/zen/go/v1/usageOpenCode Go usage endpoint
kimiBaseUrlhttps://api.kimi.com/coding/v1Kimi usage endpoint base (appends /usages)
kimiOauthHosthttps://auth.kimi.comKimi OAuth refresh endpoint (appends /api/oauth/token)
kimiClientIdKimi Code CLI's public client idOAuth client_id (usually unchanged)

Credentials

  • DeepSeek / OpenCode Go: env var named by config (defaults DEEPSEEK_API_KEY / OPENCODE_GO_API_KEY), falling back to the DSH credentials seam; OpenCode Go also falls back to the opencode-go entry in ~/.local/share/opencode/auth.json.
  • 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 login again if it is gone).

Data sources

ProviderSource
CodexLocal codex app-server --stdio JSON-RPC (account/rateLimits/read) — 5h / 7d windows
KimiGET {kimiBaseUrl}/usages (Kimi Code CLI's OAuth login state)
DeepSeekGET {deepseekBaseUrl}/user/balance (bearer key)
OpenCode GoGET {opencodeBaseUrl} (bearer key)

License

MIT