Skip to content

slkiser/opencode-quota

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

475 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Quota logo

Quota, usage, and token visibility for OpenCode and CLI.

npm npm downloads CI License: MIT

OpenCode Quota sidebar


Quick start

npx @slkiser/opencode-quota init

Important

OpenCode >= 1.4.3 and Node.js >= 20 are required.

  1. Restart OpenCode.
  2. Run /quota in OpenCode, or use opencode-quota show from your terminal.
  3. If you enabled the Sidebar panel, open the session sidebar and look for Quota.
  4. If you enabled Compact status line, look for the home-bottom quota line and the chat/session prompt quota line.
  5. If something looks wrong, run /quota_status in OpenCode or see Troubleshooting.

What you get

OpenCode Quota TUI sidebar panel OpenCode Quota popup toast
Sidebar panel
A full quota view in OpenCode's session sidebar.
Toast
Popup quota checks after idle, question, or compact events.
OpenCode Quota TUI status line OpenCode Quota token report
Compact status line
Short quota text on home and chat/session prompt surfaces.
Token reports
/tokens_today, /tokens_weekly, session reports, and more.

More ways to use it:

  • Terminal checks with opencode-quota show before or without opening OpenCode
  • JSON output for scripts, status bars, CI checks, and external tools
  • Local TUI dialogs for slash commands when the TUI plugin is installed
  • Provider diagnostics for auth, quota sources, pricing, and bundled maintainer announcements

See Configuration for UI options and Manual install for setup details.

Commands

Core slash commands

Command Use when
/quota Show your quota and usage details
/quota_status Diagnose setup, auth, provider detection, pricing, and announcements
/quota_announcements Read active bundled maintainer notices
/pricing_refresh Refresh local runtime pricing from models.dev
/tokens_today Show tokens used today
/tokens_daily Show tokens used in the last 24 hours
/tokens_weekly Show tokens used in the last 7 days
/tokens_monthly Show tokens used in the last 30 days, including pricing
/tokens_all Show tokens used across all local history
/tokens_session Show tokens used in the current session
/tokens_session_all Show current session plus descendant sessions
/tokens_between YYYY-MM-DD YYYY-MM-DD Show tokens used between two dates

CLI commands

Command Use when
opencode-quota show Check quota from your terminal
opencode-quota show --provider <id> Check one provider only, such as copilot or openai
opencode-quota show --json Print JSON for scripts, status bars, and other tools
opencode-quota show --json --threshold <pct> Fail the command when cached quota drops below your chosen percentage

Providers

Most providers work automatically. If a provider has a “Needs setup” link, open that setup note only if you use that provider.

Provider Auth/setup Source Reports
Anthropic (Claude) Needs setup Local CLI/OAuth Usage/quota
GitHub Copilot OpenCode OAuth or PAT Remote API Quota/usage
OpenAI Automatic Remote API Usage/quota
Cursor Needs setup Local estimate Estimated quota
Qwen Code Needs setup Local estimate Estimated quota
Alibaba Coding Plan OpenCode config Local estimate Estimated quota
MiniMax Coding Plan OpenCode config Remote API Usage/quota
MiniMax Coding Plan (CN) OpenCode config Remote API Usage/quota
Kimi Code OpenCode config Remote API Usage/quota
Chutes AI API key/config Remote API Usage/quota
Synthetic Automatic Remote API Quota
Google Antigravity Needs setup Remote API Usage/quota
Google AGY Needs setup Remote API Usage/quota
Gemini CLI Needs setup Remote API Usage/quota
Z.ai Coding Plan OpenCode config Remote API Usage/quota
Zhipu Coding Plan OpenCode config Remote API Usage/quota
NanoGPT API key/config Remote API Usage + balance
DeepSeek API key/config Remote API Balance/status
Ollama Cloud Needs setup Dashboard scraping Dashboard usage
OpenCode Go Needs setup Dashboard scraping Dashboard usage

Setup details live in the Provider setup guide.

Troubleshooting

Start here when quota or token data looks wrong:

  1. Run /quota_status, or start with opencode-quota show for a terminal quota summary.
  2. Confirm the expected provider appears in the detected provider list.
  3. Confirm companion auth plugins are before @slkiser/opencode-quota in opencode.json.
  4. If token reports are empty, start OpenCode once so it creates opencode.db, then run a session with model usage.
  5. Check Troubleshooting for common symptoms and provider-specific fixes.

Reference

Contributors

Thanks to everyone who has contributed to OpenCode Quota.

License

MIT

Remarks

OpenCode Quota is not built by the OpenCode team and is not affiliated with OpenCode or any provider listed above.

Star history

Star History Chart

About

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.

Topics

Resources

License

Contributing

Stars

698 stars

Watchers

3 watching

Forks

Contributors