Track Pi usage across your sessions in one dashboard. @pi-vault/pi-usage combines offline history with live provider snapshots so you can review costs, tokens, session activity, current quotas, and usage insights without leaving Pi.
pi install npm:@pi-vault/pi-usageThen reload Pi:
/reloadOpen the dashboard with cached data:
/usage
Force a live refresh, rescan local history, and reopen:
/usage:refresh
| Command | Purpose |
|---|---|
/usage |
Open the dashboard. Uses cached live data when available. Quick inspection. |
/usage:refresh |
Force a live refresh, rescan local session history, then open the dashboard. |
The dashboard renders as a tabbed overlay. Switch tabs with Tab / Shift-Tab.
Aggregates local Pi session history for the selected period.
- Period selector:
Today,This Week,Last Week,All Time. - Aggregated provider/model table with expandable rows.
- Total row for everything currently shown.
- Per-row counts for sessions, messages, cost, total tokens, input, output, cache reads, and cache writes.
Shows supported live providers. Configured providers return live quota and balance data; unconfigured ones may show unavailable or a local fallback.
- Provider selector:
OpenAI/Codex,MiniMax,StepFun,OpenCode Go,Command Code,OpenRouter. - Rolling-window quota bars (e.g.
5h, weekly). - Balance-style fields where the provider exposes them.
- Inline status:
live,cached,stale,local,unavailable.
Breakdowns for the selected period. Toggle visibility by switching to this tab.
- Most expensive projects in your local session history.
- Active skill breakdown when that data is present.
- MCP server breakdown when that data is present.
- Grouped insight categories with capped lists and overflow summaries so long sections stay readable.
The Insights period selector is independent of the Usage Statistics period.
Global:
[Tab]next tab.[Shift-Tab]previous tab.[q]/[Esc]close the dashboard.
Usage Statistics tab:
[Left/Right]switch period.[Up/Down]move through rows.[Enter]/[Space]expand or collapse the selected provider row.
Current Usage tab:
[Left/Right]switch provider.
Insights tab:
[Left/Right]switch period.
The footer at the bottom of the dashboard shows the contextual shortcuts for the active tab.
Create $PI_CODING_AGENT_DIR/extensions/usage.json to disable specific live providers.
Default behavior:
- File missing: all providers stay enabled.
- File is
{}: all providers stay enabled. - Provider omitted: that provider stays enabled.
- JSON malformed:
@pi-vault/pi-usageignores it and falls back to the default behavior.
Default example:
{}Explicit all-providers-enabled example:
{
"providers": {
"openai-codex": { "enabled": true },
"minimax": { "enabled": true },
"stepfun": { "enabled": true },
"opencode-go": { "enabled": true },
"command-code": { "enabled": true },
"openrouter": { "enabled": true }
}
}Disable MiniMax only:
{
"providers": {
"minimax": { "enabled": false }
}
}Offline history works without extra setup. Provider cards appear for every supported live provider unless you disable them in usage.json. Providers you configure can return live data; others may show unavailable or a local fallback state.
Pi usage can reuse existing Pi or Codex auth. Optional overrides:
OPENAI_CODEX_OAUTH_TOKENOPENAI_CODEX_ACCESS_TOKENCODEX_OAUTH_TOKENCODEX_ACCESS_TOKENOPENAI_CODEX_ACCOUNT_IDCHATGPT_ACCOUNT_ID
Set one of:
MINIMAX_CODING_API_KEYMINIMAX_API_KEY
Optional override:
MINIMAX_API_HOST
Set one of:
STEPFUN_TOKENSTEPFUN_USERNAMEandSTEPFUN_PASSWORD
Set:
OPENCODE_GO_COOKIE_HEADEROPENCODE_GO_WORKSPACE_ID
OPENCODE_GO_WORKSPACE_ID accepts either the raw wrk_... id or the full workspace URL.
Set:
COMMAND_CODE_COOKIE_HEADER
Set:
OPENROUTER_API_KEY
Optional overrides:
OPENROUTER_API_URLOPENROUTER_X_TITLEOPENROUTER_HTTP_REFERER
See CHANGELOG.md for release-by-release notes.
MIT — see LICENSE.


