Quota and token tracking for OpenCode providers via Toasts and Commands with no LLM calls.
Quota Toasts - See your remaining quota at a glance after each assistant response.
Token Report Commands - Track token usage and estimated costs across sessions.
Add to your opencode.json:
{
"plugin": ["@slkiser/opencode-quota"]
}Enable the providers you use:
That's it. Toasts appear automatically after main agent responses.
| Command | Description |
|---|---|
/quota |
Show current quota (verbose) |
/quota_today |
Token + cost report (today, local timezone) |
/quota_daily |
Token + cost report (last 24 hours) |
/quota_weekly |
Token + cost report (last 7 days) |
/quota_monthly |
Token + cost report (last 30 days) |
/quota_all |
Token + cost report (all history) |
/quota_chat |
Token + cost report (current session only) |
/quota_status |
Diagnostics (config, paths, pricing) |
| Provider | Config id | Notes |
|---|---|---|
| GitHub Copilot | copilot |
Uses OpenCode auth* |
| OpenAI (Plus/Pro) | openai |
Uses OpenCode auth |
| Firmware AI | firmware |
Uses OpenCode auth or API key |
| Google Antigravity | google-antigravity |
Multi-account via opencode-antigravity-auth |
Firmware works automatically if OpenCode has Firmware configured. Alternatively, you can provide an API key in your opencode.json:
{
"provider": {
"firmware": {
"options": {
"apiKey": "{env:FIRMWARE_API_KEY}",
},
},
},
"experimental": {
"quotaToast": {
"enabledProviders": ["firmware"],
},
},
}The apiKey field supports the {env:VAR_NAME} syntax to reference environment variables, or you can provide the key directly.
Copilot works with no extra setup as long as OpenCode already has Copilot configured and logged in.
Optional: if Copilot quota does not show up (or you want more reliable quota reporting), you can provide a fine-grained PAT so the plugin can use GitHub's public billing API:
- Create a fine-grained PAT at GitHub with Account permissions > Plan > Read
- Create
~/.config/opencode/copilot-quota-token.json:
{
"token": "github_pat_...",
"username": "your-username",
"tier": "pro"
}Tier options: free, pro, pro+, business, enterprise
* The plugin reads Copilot auth from OpenCode. The PAT file is only a fallback for reliability.
All options go under experimental.quotaToast in opencode.json:
| Option | Default | Description |
|---|---|---|
enabled |
true |
Enable/disable plugin |
enableToast |
true |
Show popup toasts |
enabledProviders |
[] |
Provider ids to query |
minIntervalMs |
300000 |
Min ms between fetches (5 min) |
toastDurationMs |
9000 |
Toast display time |
onlyCurrentModel |
false |
Only show current model's quota |
googleModels |
["CLAUDE"] |
Google models: CLAUDE, G3PRO, G3FLASH |
debug |
false |
Show debug info in toasts |
Toast not appearing? Run /quota_status to check config and provider availability.
MIT


{ "experimental": { "quotaToast": { "enabledProviders": ["copilot", "openai", "google-antigravity"], }, }, }