npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cwillam/pi-minimax-usage

v1.1.0

Published

Pi extension: live MiniMax Token Plan usage (5h + weekly) in the status bar. Not affiliated with MiniMax Inc.

Readme

pi-minimax-usage

Pi extension that puts your MiniMax Token Plan usage in the status bar.

MiniMax 5h●43% ↺3h12m  wk●12% ↺4d8h

Two windows: the 5-hour rolling quota and the weekly quota, each as used-percent with a reset countdown. Colour shifts at 70 % (yellow) and 90 % (red). Automatically adapts to narrow laptop screens and split panes (compact / minimal mode). The block vanishes when you switch away from MiniMax.

Not affiliated with, endorsed by, or sponsored by MiniMax Inc. "MiniMax" is a trademark of MiniMax Inc. This extension only reads the publicly documented quota endpoint.

Install

pi install npm:@cwillam/pi-minimax-usage

Make sure the minimax provider is configured in pi (API key available). Restart Pi, switch to a MiniMax model, the block shows up in the footer within about a second.

Slash command

/minimax-usage           show current snapshot with visual progress bars
/minimax-usage refresh   force-poll now
/minimax-usage help      command help

Example snapshot:

MiniMax Token Plan (global • mode: compact)
  5h : [████░░░░░░]  43% used ↺ in 3h 12m (19:22)
  wk : [█░░░░░░░░░]  12% used ↺ in 4d 8h (Mon 14:00)
endpoint: https://www.minimax.io/v1/token_plan/remains
last poll: 14s ago (interval: 60s)

Settings

Optional, under minimaxUsage in ~/.pi/agent/settings.json:

{
  "minimaxUsage": {
    "refreshIntervalMs": 30000,   // min 5000, default 60000
    "host": "global",             // "global" or "cn"
    "endpoint": "https://www.minimax.io/v1/token_plan/remains",  // overrides host, must be on the allowlist
    "displayMode": "auto",        // "auto" (default), "full", "compact", or "minimal"
    "prefix": "full"              // "full" (MiniMax), "short" (MM), or "none"
  }
}

Display modes (laptop & split pane friendly)

  • auto (default): Dynamically adapts to your terminal columns (full on ≥ 115 cols, compact on ≥ 85 cols, minimal on < 85 cols).
  • full: MiniMax 5h●43% ↺3h12m wk●12% ↺4d8h (~36 chars)
  • compact: MM 5h●43% ↺3h wk●12% ↺4d (~25 chars)
  • minimal: 5h●43% wk●12% (~14 chars, keeps the footer ultra-clean)

The endpoint setting only accepts the two documented MiniMax URLs (exact match). Anything else is ignored, falls back to host.

How it works

On session start or model switch, it grabs the API key for the minimax provider via ctx.modelRegistry.getApiKeyForProvider() and polls GET /v1/token_plan/remains every refreshIntervalMs. The response's general bucket gives two *_remaining_percent fields (5h + weekly); the extension inverts them to consumed-% and paints the footer.

Wire-format details the parser handles:

  • HTTP 200 even on auth failure — the real code lives in base_resp.status_code (1004 = no key, 2049 = wrong host)
  • The *_remaining_percent fields are remaining, not consumed — inverted to match the rest of the app
  • Timestamps are epoch milliseconds, not seconds
  • Only the general bucket is shown; video/other buckets are ignored

Troubleshooting

| Symptom | Cause | Fix | | --- | --- | --- | | MiniMax no api key | No credential for minimax provider | Configure it like any other pi provider | | MiniMax 1004 or MiniMax invalid key | Key rejected for this host | Flip host between global / cn, or set endpoint to the matching URL | | Block doesn't appear | Active provider isn't minimax | Check with /model | | Stale data after model switch | Cached state cleared on switch | Next poll (~1 s) repopulates it |

Run /minimax-usage to see the current snapshot, error, and last-poll timestamp.

Credits

Wire-format field names came from ai-usagebar (Rust). Architectural pattern borrowed from @d3ara1n/pi-usage-block.

License

MIT — see LICENSE.