← Catalog

pi-usage-plus

Super usage/quota extension for Pi & Pi Web – 10+ providers, Kimi/Moonshot, OpenRouter, OpenCode Go, DeepSeek, GLM, dual Pi & Pi Web compatible

Extension

Install

Install with PiG

pig install npm:pi-usage-plus

Install with Pi

pi install npm:pi-usage-plus
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.

Pi Usage Plus

中文文档

Super usage/quota extension for Pi and pi-web — dual compatible, 10+ providers, Kimi/Moonshot, OpenRouter, OpenCode Go, DeepSeek, GLM, and pi-bridge unified quota.

Forked from @wayner6/pi-usage with expanded provider coverage and Pi & Pi Web dual-host hardening.

What it shows

  • A compact status line for the active model, such as Codex · 5h 92% · 7d 85% or Kimi · Balance ¥42.50.
  • Remaining balance, rate-limit windows, and reset times when the provider exposes them.
  • Live output speed while generating (e.g. · ⇣42 tok/s), sampled once per second from in-memory session usage — no extra network or disk I/O, hidden when idle.
  • Details for every configured provider through /usage.

The display follows the active model. It does not turn request failures into a zero balance.

Supported providers

ProviderAuthenticationAvailable information
OpenAI CodexChatGPT Plus/Pro OAuth5-hour and 7-day quota windows
xAI / GrokOAuthAccount verification and spending-limit status
Anthropic ClaudeClaude OAuth or API keySubscription status or API rate-limit headers
DeepSeekAPI keyAccount balance
GLM / Zhipu BigModelAPI keyCoding Plan quota windows; standard pay-as-you-go keys cannot be queried
OpenRouterAPI key (or OAuth)Account balance (total_credits - total_usage)
OpenCode GoAPI keyRolling 5h / weekly / monthly quota windows
Kimi / MoonshotAPI keyAccount balance (moonshot.cn / moonshot.ai auto-switch)
CLIProxyAPIpi-bridge pluginUpstream quota windows and reset times (requires pi-bridge on the proxy)
  • Pi & Pi Web dual compatible: Uses standard ExtensionAPI (setStatus/setWidget) which Pi Web's ExtensionStatusBar/ExtensionWidgets both implement. Includes Pi Web model_select watcher (750ms) so idle model switches are reflected.
  • Trust boundary: All provider requests use sameOriginFetch(url, expectedOrigin) – no cross-origin credential leak, no cookie/telemetry forwarding.

Pi Usage Plus uses Pi's existing provider authentication (OAuth tokens or API keys). CLIProxyAPI is queried via pi-bridge (Management Key never read).

Install

In Pi's terminal:

pi install npm:pi-usage-plus

In pi-web: open Settings → Plugins → Add Plugin, enter the following in Source, choose global, then select Install:

npm:pi-usage-plus

GitHub

In Pi's terminal:

pi install github:VinceJan/pi-usage-plus

In pi-web: open Settings → Plugins → Add Plugin, enter:

git:https://github.com/VinceJan/pi-usage-plus

After installing or updating, reload the session if it is already open.

Update

pi update npm:pi-usage-plus
# or
pi update --extensions

In pi-web: Settings → Plugins, select pi-usage-plus, choose Update, then use Reload Session.

Use

Send a normal message to refresh the quota for the active model. The status line then updates automatically.

In pi-web, an idle model switch is applied when the next message is sent. To refresh it immediately, use Reload Session.

CommandResult
/usage or /quotaShow all available provider balances and quotas
/usage currentShow the active model's provider only
/usage refreshRefresh the active provider now
/usage doctorShow authentication, adapter, and bridge diagnostics
/usage settingsShow current plugin settings

Settings

Use /usage settings followed by one of these commands:

/usage settings status on|off       # status line; on by default
/usage settings rate on|off         # live tok/s in the status line; on by default, hidden when idle
/usage settings widget on|off       # detailed widget; off by default
/usage settings interval <seconds>  # refresh interval; 120 by default
/usage settings timeout <seconds>   # request timeout; 10 by default

Settings are stored locally at ~/.pi/agent/pi-usage/config.json.

Privacy

Same as upstream: no browser cookies, telemetry, cloud sync, or third-party credential forwarding. Requests stay on the provider's official origin.

Credits

  • Upstream: @wayner6/pi-usage – original architecture, pi-bridge, GLM/Dual integration
  • Provider APIs: OpenRouter, OpenCode AI, Moonshot, DeepSeek, Anthropic, etc.
  • Community: LINUX DO

License

MIT