Skip to content

feat: add MiniMax token-plan provider - #34

Closed
lamchun1110 wants to merge 1 commit into
deviffyy:mainfrom
lamchun1110:feat/minimax-provider
Closed

feat: add MiniMax token-plan provider#34
lamchun1110 wants to merge 1 commit into
deviffyy:mainfrom
lamchun1110:feat/minimax-provider

Conversation

@lamchun1110

Copy link
Copy Markdown
Contributor

Adds a MiniMax provider so OpenQuota can show MiniMax token-plan usage.

What

  • New provider at providers/minimax/ (modeled on providers/zai/): client, mapper, auth, mod.
  • Reports two quotas using the existing naming convention:
    • Session — the per-interval remaining percent (current_interval_remaining_percent)
    • Weekly — the weekly remaining percent (current_weekly_remaining_percent)
    • Uses the general model entry, falling back to the first model if general is absent.
  • Source: GET https://www.minimax.io/v1/token_plan/remains, Bearer API key.
  • Success is gated on base_resp.status_code == 0; a "no token plan" message maps to a Permission error (like Z.ai's NoCodingPlan).
  • Key stored in the OS keychain (or MINIMAX_API_KEY / ~/.config/openquota/minimax.json), wrapped in Zeroizing, never logged.
  • Registered in the runtime list (lib.rs), declared in providers/mod.rs, covered by the provider-registry contract and the provider-links test.
  • Unit tests: captured payload mapping, model fallback, error classification, missing/invalid/rate-limited keys.

Verification

  • `cargo test -p openquota minimax` — 7/7 passing
  • `pnpm verify:contracts` — 11 runtimes; `pnpm check` — 0 errors

Caveat

The `/v1/token_plan/remains` endpoint is undocumented (discovered against the live API). Field paths may need adjustment if MiniMax changes the response.

Contributed under the repo's MIT license. Built/tested on Linux and macOS.

Adds a MiniMax provider reporting Session (per-interval) and Weekly
remaining quotas from GET https://www.minimax.io/v1/token_plan/remains
using a Bearer API key. Modeled on providers/zai: client + mapper + auth,
keychain-backed key (zeroized), success checked via base_resp.status_code,
with a 'no token plan' -> permission error. Registered + contract/links
covered, with unit tests.
@lamchun1110

Copy link
Copy Markdown
Contributor Author

Superseded by #38, which combines Kimi and MiniMax into a single PR. The two were split across branches that touch the same shared files (registry, contract test, icon map) and would conflict on merge, and #38 also includes the status-bar icon fix so the logos render in the menu bar. Closing in favor of #38.

@lamchun1110 lamchun1110 closed this Aug 8, 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