{"slug": "show-hn-a-pi-extension-to-monitor-your-quota-for-opencode-go-et-commandcode", "title": "Show HN: A Pi extension to monitor your quota for OpenCode GO et CommandCode", "summary": "A new open-source extension for the pi.dev terminal AI tool displays subscription quota usage for OpenCode Go and Command Code providers in the status bar, with color-coded 5-hour and monthly windows, reset countdowns, and auto-refresh every 60 seconds. The extension, installable via 'pi install npm:pi-quota-monitoring', queries each provider's usage API and shows the quota only when a supported model is active.", "body_md": "A [pi](https://pi.dev) extension that shows your **subscription quota usage (%)** in the status bar.\n\nSupported providers:\n\n| Provider | Label | Quota source |\n|---|---|---|\n`commandcode` ) |\n\n`CC`\n\n`api.commandcode.ai`\n\nbilling period + 5h window[OpenCode Go](https://opencode.ai)(`opencode-go`\n\n)`OG`\n\n`opencode.ai/zen/go/v1/usage`\n\nrolling windowThe quota only appears when you're using a model from a supported provider. Switch to any other provider (e.g. `minimax`\n\n) and the display clears automatically.\n\nIn the pi footer, the extension shows one segment per usage window:\n\n```\nCC 5h: 15% resets in 2h · mois: 3% resets in 4d\nOG 5h: 10% resets in 2h · mois: 27% resets in 13d\n```\n\nIf you also have [pi-token-speed](https://github.com/gsanhueza/pi-token-speed) installed, the quota appears to the **right of your TPS** readout (the `zz-quota`\n\nstatus key sorts right after `tokenSpeed`\n\n).\n\n**Two windows shown**: the** 5-hour**window (tighter limit, with reset countdown) and the** monthly**billing period** Color-coded**: green (ok), yellow (≥70% used), red (≥90% used)** Reset countdown**: each window shows`resets in 2h`\n\n/`5m`\n\n/`1d`\n\nuntil it resets - the 5h window uses the provider's real reset timestamp; the monthly window uses the provider's reset timestamp when available (OpenCode Go), otherwise the next calendar-month start (Command Code)**Auto-refresh**: every 60s and after every agent turn** Command Code**shows the 5-hour window + monthly billing-period total** OpenCode Go**shows the rolling (≈5h) + monthly windows\n\n```\npi install npm:pi-quota-monitoring\n```\n\nThen `/reload`\n\nor restart pi.\n\nNothing to configure. Pick a model from a supported provider and the quota shows up in the footer.\n\nThe extension reads the API key from pi's model registry (falling back to the standard auth stores), then queries each provider's usage endpoint:\n\n**Command Code**:`GET https://api.commandcode.ai/alpha/whoami`\n\n→`GET /alpha/billing/credits`\n\n+`GET /alpha/usage/summary`\n\n- computes the 5-hour window percentage and the monthly billing-period percentage (`used / total`\n\n).**OpenCode Go**:`GET https://opencode.ai/zen/go/v1/usage`\n\n- the API returns`rolling`\n\n(≈5h) and`monthly`\n\npercentages directly.\n\nThe status is set under the key `zz-quota`\n\n, which sorts alphabetically just after `tokenSpeed`\n\nin pi's footer (when [pi-token-speed](https://github.com/gsanhueza/pi-token-speed) is installed), placing the quota to the **right** of the TPS display.\n\nMIT", "url": "https://wpnews.pro/news/show-hn-a-pi-extension-to-monitor-your-quota-for-opencode-go-et-commandcode", "canonical_source": "https://github.com/Anhydrite/pi-quota-monitoring", "published_at": "2026-08-31 08:50:38+00:00", "updated_at": "2026-08-31 09:23:17.696006+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["pi.dev", "OpenCode Go", "Command Code", "pi-token-speed"], "alternates": {"html": "https://wpnews.pro/news/show-hn-a-pi-extension-to-monitor-your-quota-for-opencode-go-et-commandcode", "markdown": "https://wpnews.pro/news/show-hn-a-pi-extension-to-monitor-your-quota-for-opencode-go-et-commandcode.md", "text": "https://wpnews.pro/news/show-hn-a-pi-extension-to-monitor-your-quota-for-opencode-go-et-commandcode.txt", "jsonld": "https://wpnews.pro/news/show-hn-a-pi-extension-to-monitor-your-quota-for-opencode-go-et-commandcode.jsonld"}}