slkiser/opencode-quota
Sobre
Uso de cota e tokens do OpenCode sem poluir a janela de contexto. Compatível com OpenCode Go, Cursor, GitHub Copilot, OpenAl, Kimi Code, Alibaba Coding Plan, Chutes Al, Google Antigravity, Z.ai Coding Plan e muito mais.
IA e aprendizado de máquinaCrescimento medido de estrelas
- em 24 h
- +2
- em 7 dias
- +10
- em 15 dias
- +27
- em 1 mês
- +72
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalQuota, usage and cost in OpenCode TUI and Desktop.
English | 简体中文 | 繁體中文 | Français | Deutsch | 日本語 | Español
Install
opencode plugin add @slkiser/opencode-quota
Restart OpenCode and type /quota. A window opens with your limits. Click a tab (Usage, Limits, Plugin, or a Settings tab) or press tab to move between them; click or press esc to close it.
[!IMPORTANT] You need OpenCode
2.0.26+; the terminal commands also need Node.js22.13+or23.4+.
[!NOTE] Still on OpenCode 1? Run
npx @slkiser/opencode-quota@4 initinstead, and see the OpenCode 1 README.
Edit opencode.json yourself
Add the plugin to opencode.jsonc or opencode.json, and keep your other plugins. In ~/.config/opencode it works in every project; in a project's folder, only there. This one entry loads both the server and the TUI:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@slkiser/opencode-quota"],
}
What you get
- TUI: a
/quotawindow, a sidebar panel, a status line and toasts. - Desktop (experimental, OpenCode
2.2.0+): a side tab, pills, a bottom strip, toasts, a usage window (Quota command) and a settings page. Turn it off in Settings → Extensions → Plugins.Where each setting shows in the TUI and in Desktop
Setting group TUI Desktop sidebarQuota panel in the sidebar Quota side tab collapsedSidebar panel folded to one line per provider Titlebar pill, and the Quota side tab when folded statusLineLine under the message box Strip at the bottom of the window, and the pill above the message box toastToasts with bars Toasts with the Quota side tab's rows and bars; a reset notice is a sentence Note: in the TUI the status line hides while the sidebar shows quota, unless Next to the sidebar (
statusLine.withSidebar) is on. In Desktop the strip also shows next to the Quota side tab by default; Next to the side panel (statusLine.withSidePanel) turns that off.statusLine.composerPill: false(Pill above the message box) hides only the pill in Desktop. - Web:
/quota,/quota_usageand/quota_statuspost a report in the chat. The AI never sees it. - Terminal:
npx @slkiser/opencode-quota@latest show, even with OpenCode closed. - Scripts and status bars: JSON, an export file and metrics (how).
- Live settings in every open OpenCode.
Commands
| Command | What it shows |
|---|---|
/quota |
Limits. Web and Desktop: limits next to the last 7 days of usage |
/quota_usage [range] |
Tokens and API cost: today (default), 24h, 7d, 30d, 90d, all, session (with its subagents), between two dates |
/quota_status |
Setup check: logins, providers, pricing, and notices |
/quota_settings |
Settings tabs (TUI only) |
For example /quota_usage 30d or /quota_usage between 2026-09-01 2026-09-25. In a terminal, with OpenCode open or closed, npx @slkiser/opencode-quota@latest show shows your quota and npx @slkiser/opencode-quota@latest status checks your setup (how they differ). Add --help to see all options.
Settings
- Change settings in
/quota_settings(TUI) or the Quota page in Desktop's settings. Both save toopencode-quota/settings.jsoncin OpenCode's config folder and keep your comments. - Custom providers, the Claude CLI path and the export path are set only in the file.
- The
┃in a bar marks even use until the reset. Even-use mark (layout.evenUse) turns it off. - Settings and defaults
Providers
Log in with /connect and the provider shows up. Switch providers on or off in /quota_settings → Providers.
|
|
* Linked names need one more step; the rest work once you log in. What each one reports.
- OpenAI ChatGPT needs a Codex login (how).
- Gemini CLI works only with Gemini Code Assist Standard or Enterprise (organization) accounts. Personal Google accounts use Google AGY.
- Business plans of the Chinese providers show only your own API key's usage (Alibaba Token Plan: one Credits row per seat).
- API keys come from OpenCode or an environment variable.
Custom providers
Track any other provider, from its quota API or from a local estimate. Ask your agent to add a custom provider: it is saved switched off, and you switch it on in /quota_settings → Providers. Copy-paste prompt.
Updating
opencode plugin update
Restart OpenCode. Coming from 4.x or 5.x? Your settings convert on the first start, and the old /tokens_* commands still work. See Updating.
Troubleshooting
- Run
/quota_statusin an OpenCode session, ornpx @slkiser/opencode-quota@latest statusin a terminal. - Provider missing? Log in to it again in OpenCode 2.
- Using a companion plugin (Cursor, Google)? List it before
@slkiser/opencode-quotainopencode.json. claudeorblnot found? See Service environment./quota_usageempty? Start OpenCode once, then use a model.- No Quota GUI in Desktop? It needs OpenCode
2.2.0+and its switch on in Settings → Extensions → Plugins. Web shows no plugin GUI.
More fixes: Troubleshooting.
Reference
Guides: Configuration · Providers · Troubleshooting · External integration · Updating
Outside links: OpenCode docs · OpenCode config · OpenCode plugins · OpenCode TUI · models.dev pricing data · Node.js downloads
Contributors
Thanks to everyone who has contributed to OpenCode Quota.
License
MIT. OpenCode Quota is not built by the OpenCode team and is not affiliated with OpenCode or any provider listed above.
Explore projetos relacionados
Carregando…
