Usage Left
OpenCode TUI sidebar showing quota percentages, reset times, and credit balances for connected providers.
2
+1 in 30 days
108
28 in 7 days
36.5
Multi-signal model
1 month ago
2026-08-23
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-usage-left@1.0.6"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-usage-left@1.0.6"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-usage-leftOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
OpenCode TUI plugin that lists every provider shown by opencode auth list in the session sidebar.
- Percentage quotas show a bar, percentage remaining, and time until reset.
- Credit quotas show the provider, balance, and amount left.
- Click the section or any provider header to fold and unfold it.
- Providers without an accessible usage API remain listed as unavailable.
- Credentials are read from OpenCode's XDG auth store on every refresh and are never logged or cached.
Supported usage adapters: OpenAI/Codex, Anthropic OAuth, OpenRouter, Z.AI Coding Plan, Synthetic, MiniMax Token Plan, OpenCode Zen, and OpenCode Go.
OpenCode does not currently expose Zen balance or Go quota endpoints for API keys. Their adapters use the authenticated workspace dashboard. Store the credentials in ~/.config/opencode/opencode-usage-left.json:
{
"openCode": {
"workspaceId": "wrk_...",
"authCookie": "your-opencode.ai-auth-cookie"
}
}
Protect the browser session cookie from other users:
chmod 600 ~/.config/opencode/opencode-usage-left.json
The plugin follows XDG_CONFIG_HOME. Set OPENCODE_USAGE_LEFT_CONFIG to use another path. Environment variables are temporary overrides and take precedence over the file:
export OPENCODE_GO_WORKSPACE_ID="wrk_..."
export OPENCODE_GO_AUTH_COOKIE="your-opencode.ai-auth-cookie"
Find the auth cookie in your browser's developer tools under Storage/Cookies for opencode.ai. It is only sent to fixed https://opencode.ai/workspace/... URLs and is never logged or cached. Without stored credentials, Zen and Go display need creds.
Install
Install the package, then add it to ~/.config/opencode/tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["opencode-usage-left"]
}
For local development, use the package directory so OpenCode resolves its runtime-safe ./tui source entrypoint:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["/absolute/path/to/opencode-usage-left"]
}
Restart OpenCode after changing tui.json.
Options
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
[
"opencode-usage-left",
{
"refreshIntervalSeconds": 60,
"requestTimeoutMs": 10000,
"showUnavailable": true
}
]
]
}
Provider quota endpoints are not standardized and some are private APIs that may change. A failed provider request is isolated and does not prevent other balances from rendering.
Similar plugins
Usage Report
opencode-usage-report
opencode plugin: /usage command showing subscription quota windows for configured providers
Tui Quota Usage
opencode-tui-quota-usage
OpenCode quota usage sidebar tracker for OpenCode V2 CLI/TUI
Providers Balances
opencode-providers-balances
OpenCode TUI plugin that shows provider account balances in the session sidebar. Providers are configured entirely in opencode.jsonc.