pi-subscription-meter
Pi extension scaffolding for showing subscription and quota usage across AI providers.
Package details
Install pi-subscription-meter from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-subscription-meter- Package
pi-subscription-meter- Version
0.5.0- Published
- Aug 24, 2026
- Downloads
- 470/mo · 29/wk
- Author
- championswimmer
- License
- MIT
- Types
- extension
- Size
- 140.7 KB
- Dependencies
- 0 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/extensions/core/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-subscription-meter
A Pi extension package for surfacing subscription, quota, and usage limits across AI providers.
Check out my other Pi extensions
— Auto-syncs Pi theme with OS dark/light mode.
— Real-time prompt cache hit rates and token metrics.
— Prunes verbose tool outputs from context while preserving history.
— Dot-grid visualization of context window token usage.
— Live tokens/sec and TTFT in the status bar.
— Tracks subscription quotas and rate limits across AI providers.
Status
Early framework in place.
This repository currently contains:
- npm + TypeScript package setup for a Pi extension
- a
/subscriptionsPi command - a tabbed Pi TUI dialog that renders one tab per enabled provider
- a pluggable provider registry with live OpenAI Codex, GitHub Copilot, Anthropic, OpenRouter, and xAI SuperGrok support plus an OpenCode scaffold
- repo-level agent instructions in
AGENTS.md - Agent Skills under
.agents/skills/ - an implementation planning workflow under
.agents/plans/
Actual subscription fetching, auth wiring, and live usage meters will come next.
Initial scope
The extension is intended to track or summarize subscription/usage information for providers such as:
- Anthropic
- OpenAI / ChatGPT / Codex
- OpenRouter
- OpenCode
- GitHub Copilot
- xAI SuperGrok (via Pi
/login xaisubscription OAuth)
Inspiration
This project is intentionally inspired by:
latentminds-ai/pi-quotas- https://github.com/latentminds-ai/pi-quotas
Development
npm install
npm run typecheck
Current command
Once this extension is loaded in Pi, use:
/subscriptions
This opens a tabbed dialog showing all currently enabled provider scaffolds.
Press s inside the dialog to open provider settings in a sub-dialog overlay and enable/disable providers.
Enabled providers
Enabled providers are determined by saved extension settings.
The extension stores its settings in the Pi agent directory using the documented Pi helper for resolving that path (getAgentDir()), and writes:
~/.pi/agent/subscription-meter.json
If PI_CODING_AGENT_DIR is set, Pi’s configured agent directory override is respected automatically.
Use the in-app settings overlay opened with s from /subscriptions to update provider enablement.
xAI SuperGrok
Run /login xai and choose Use a subscription. The xAI tab reuses Pi’s managed OAuth credential to show the shared SuperGrok subscription period and any usage percentage xAI reports. It uses undocumented Grok CLI proxy billing endpoints, so response fields can vary or change without notice. XAI_API_KEY is intentionally not used here because it represents billed xAI API access, not a personal SuperGrok subscription.
Planned package shape
src/extensions/core/index.ts— Pi extension entrypoint.agents/skills/— reusable Agent Skills for planning and provider research.agents/plans/— implementation plans created before work begins