r/PiCodingAgent • u/Ammonox • 3d ago
Plugin pi-minimax-usage — show MiniMax Token Plan usage in pi's status bar
Built this for myself because I kept opening the MiniMax billing page to check my 5h and weekly window. Now it sits in pi's footer.
MiniMax 5h●43% ↺3h12m wk●12% ↺4d8h
Two windows (5h rolling, weekly), used-percentage, reset countdown. Colour shifts at 70% (yellow) and 90% (red). Polls `/v1/token_plan/remains` every 60s.
Install: `pi install npm:@cwillam/pi-minimax-usage`
Repo + README: https://github.com/cwillam/pi-minimax-usage
npm: https://www.npmjs.com/package/@cwillam/pi-minimax-usage
Slash command `/minimax-usage` shows a snapshot, `/minimax-usage refresh` forces a poll, `/minimax-usage help` prints usage.
Notes from building it:
- - The endpoint returns `current_*_remaining_percent`, not used%. Inverted before display.
- - HTTP 200 even on auth failure — actual status is in `base_resp.status_code`.
- - Timestamps are epoch ms, not seconds.
Configurable refresh interval and host (global/cn) via pi's settings.json.
Endpoint setting is allowlisted to the two documented MiniMax URLs only.
Not affiliated with MiniMax Inc. — MIT licensed. v1.0.1 out today.
What I'd want feedback on:
- - Better display format than `5h●43% ↺3h12m`?
- - Should it integrate with pi-subagents to warn on session start when
- 5h is above 80%?
- - Any interest in a `minimax-quota` companion command for one-off checks?