Check your OpenCode Go subscription usage from the CLI.
$ opencode-go-usage
OpenCode Go Usage:
Rolling (5h) : 10% [██░░░░░░░░░░░░░░░░░░] resets in 2h 20m
Weekly : 11% [██░░░░░░░░░░░░░░░░░░] resets in 3d 12h
Monthly : 19% [███░░░░░░░░░░░░░░░░░] resets in 21d 21h
uvx --from git+https://github.com/Hemilt0n/opencode-go-usage opencode-go-usageOr run from source:
git clone https://github.com/Hemilt0n/opencode-go-usage
cd opencode-go-usage
uv sync
uv run opencode-go-usageCreate .env.private in the directory you run the command from:
OPENCODE_GO_WORKSPACE_ID=wrk_...
OPENCODE_GO_AUTH_COOKIE=Fe26.2**...
Workspace ID — from https://opencode.ai/workspace/<ID>/go.
Auth cookie — open DevTools (F12) in your browser while logged into opencode.ai:
- Application tab → Cookies →
https://opencode.ai - Copy the
authcookie value (starts withFe26.2**)
You can also use environment variables instead of .env.private:
export OPENCODE_GO_WORKSPACE_ID=wrk_...
export OPENCODE_GO_AUTH_COOKIE=Fe26.2**...A PR is open to add GET /zen/go/v1/usage. Once merged, you'll be able to use the Go API key directly:
OPENCODE_GO_API_KEY=sk-...
opencode-go-usage [--json]
--json outputs machine-readable JSON.
Colors: green (<50%), yellow (50–80%), red (>80%).
OpenCode — the AI coding agent.