Quota, usage and cost in OpenCode TUI and Desktop. English | 简体中文 | 繁體中文 | Français | Deutsch | 日本語 | Español Install 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.js 22.13+ or 23.4+. [!NOTE] Still…
OpenCode quota & tokens usage with zero context window pollution. Supports OpenCode Go, Cursor, GitHub Copilot, OpenAl (Plus/Pro), Kimi Code, Alibaba Coding Plan, Chutes Al, Google Antigravity, Z.ai Coding Plan and more.
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.js 22.13+ or 23.4+.
Note 注意
Still on OpenCode 1? Run npx @slkiser/opencode-quota@4 init instead, 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:
TUI: a /quota window, 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
sidebar
Quota panel in the sidebar
Quota side tab
collapsed
Sidebar panel folded to one line per provider
Titlebar pill, and the Quota side tab when folded
statusLine
Line under the message box
Strip at the bottom of the window, and the pill above the message box
toast
Toasts 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_usage and /quota_status post 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 to opencode-quota/settings.jsonc in 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.
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_status in an OpenCode session, or npx @slkiser/opencode-quota@latest status in a terminal.
Provider missing? Log in to it again in OpenCode 2.
Using a companion plugin (Cursor, Google)? List it before@slkiser/opencode-quota in opencode.json.
评论