OpenCode usage
See OpenCode Go's 5-hour, weekly, and monthly usage limits beside the work.
Overview
Know how much of your OpenCode Go allowance is left before a long run starts, without leaving BB for the OpenCode Console.
What you get
- A context-window-style ring with its percentage beside it, next to the composer's own context button. Hover or click for a popover with the 5-hour, weekly, and monthly breakdown, plus a quick Tightest / 5h / Week / Month selector and an Open details link. Move away, click outside, scroll, or press Escape to close.
- An OpenCode usage page with the 5-hour, weekly, and monthly meters, reset times, and a Display section. The Display section turns the composer ring on or off, picks which window it tracks, and changes its accent color.
- A
bb opencode-usagecommand and anopencode_go_usageagent tool, so scripts and agents can check the limits too. - A settings section that shows the current meters beside the optional API-key field.
How it works
The plugin calls https://opencode.ai/inference/go/v1/usage — the endpoint
OpenCode documents for clients that want to show Go usage. By default it uses
an OpenCode Go API key from Settings → Plugins → OpenCode usage or the
OPENCODE_API_KEY environment variable.
For a key, create a Restricted key with Usage: Read permission and a 30–90 day expiry, then revoke it when you stop using the plugin. The key is stored server-side in BB's secret store and is never returned to the plugin UI.
When no key is set, the plugin reads the opencode-go credential from the
local OpenCode CLI store: opencode.db under ~/.local/share/opencode,
$XDG_DATA_HOME/opencode, or %LOCALAPPDATA%\opencode, plus a legacy
auth.json in the same directories. It does not read the generic opencode
account entry unless the fallback below is enabled.
Users whose Go access comes from the general OpenCode account can enable
Use OpenCode account sign-in to fall back to that credential when no
opencode-go credential is available. Enable it only when the account is the
same one that owns the Go plan; otherwise it can show another account's
allowance. The plugin prefers opencode-go credentials first.
BB plugins run with full trust in the BB server process. Install from a source and release you trust.
For agents
The bundled skill tells an agent to run bb opencode-usage before a long task
on opencode-go. The command exits non-zero with a setup hint when no usable
credential is available.
More in Token Usage & Limits 59
Understand or control token, context-window, and provider-quota use.



