Skip to content

feat: provider usage quotas and balances for 15 API-key providers - #59

Merged
FinbackYu merged 6 commits into
mainfrom
feat/coding-plan-quota
Oct 23, 2026
Merged

FinbackYu merged 6 commits into
mainfrom
feat/coding-plan-quota

Conversation

@FinbackYu

Copy link
Copy Markdown
Owner

User-visible change

The HUD now shows subscription usage windows or API balances for the active provider, selected by the provider's official base_url host (never by its config name):

  • Windows: opencode-go (5h/7d/mo), zhipuai-coding-plan (5h/7d/mcp, CN balance fallback when the plan lapses), synthetic, chutes, openrouter (spending-cap windows), clinepass, command-code, minimax (subscription keys)
  • Balances: deepseek, moonshot, deepinfra, ollama, kilo, vercel-ai-gateway, minimax (sk-api-* PAYG keys), venice (ADMIN keys)
  • All render with the same gauge bars as the managed Kimi quota (5h ▓▓ N% ~XhYm); the monthly label is now mo in both channels
  • Display-name fallback now fails closed when two providers share one display_name (e.g. deepseek vs opencode-go both showing "DeepSeek V4.1 Flash"), instead of attributing the wrong provider's balance

Credentials are only ever sent to the provider's official host; every fetch is size-capped, deadline-bound and backed off per account fingerprint. Keys never enter caches, logs or fixtures.

Verification

  • npm test — 821 tests, 820 pass, 1 pre-existing skip
  • node scripts/check-contracts.mjs (workspace root gate) — green
  • Real-account e2e (sandboxed HOME, symlinked config): OpenCode Go windows and Zhipu CN balance fallback rendered from live fetches; cache files hold only a 16-char credential fingerprint
  • OpenRouter smoke against the real endpoint with a fake key: 401 → unauthorized → silent hide, no cache write

Notes

  • 12 of the 15 adapters carry fixture-level evidence only (ported from CodexBar-observed contracts); no live account was available for them
  • mimo/alibaba-coding-plan/doubao/zenmux are intentionally unsupported (KI-24 documents the admission bar)

@FinbackYu
FinbackYu merged commit bd8a481 into main Oct 23, 2026
13 checks passed
@FinbackYu FinbackYu mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant