Skip to content

Repository files navigation

OpenCode Quota logo

Quota, usage, and token visibility in OpenCode and your terminal.

npm npm downloads CI License: MIT Help us get listed: opencode#38281

OpenCode Quota sidebar


Quick start

npx @slkiser/opencode-quota init

Then restart OpenCode and type /quota.

Important

You need OpenCode 2.0.16+ and Node.js 22.13+ or 23.4+. Still on OpenCode 1? Run npx @slkiser/opencode-quota@4 init instead.

Upgrading from 4.x? Read what changed in 5.0.

What you get

OpenCode Quota TUI sidebar panel
Sidebar panel
OpenCode Quota popup toast
Popup toast
OpenCode Quota TUI status line
Status line
OpenCode Quota token report
Token reports

Also:

  • Terminal: npx @slkiser/opencode-quota@latest show works even with OpenCode closed.
  • Web and Desktop: slash commands post the report in the chat.
  • Scripts and status bars: JSON, an export file, and metrics. See External integration.
  • Your look: used or left, reset style, a runs-out estimate, and more. See Configuration.

Updating

Close OpenCode, then preview and apply the update:

npx @slkiser/opencode-quota@latest update --dry-run
npx @slkiser/opencode-quota@latest update

Restart OpenCode. The updater never moves or deletes secrets. See Updating safely.

Breaking changes in 5.0.0

Warning

  • OpenCode 1 is no longer supported. init and update keep OpenCode 1 users on 4.x (@slkiser/opencode-quota@4).
  • Logins come from OpenCode 2, never from auth.json. If a provider is missing, log in again.
  • Web and Desktop get the slash commands, but no toasts or panels.
  • TUI reports open in a popup. To keep them in the chat, set tuiCommandDisplay: "inline".
  • OpenCode Zen uses your OpenCode Console sign-in: opencode auth login opencode.

Full list: Moving to OpenCode 2.

Commands

Slash commands

Type these in OpenCode. Add dates after the command, like /tokens_between 2026-09-01 2026-09-25.

Command What it shows
/quota Current quota
/quota_status Setup check: logins, providers, pricing, and notices
/quota_announcements Maintainer notices
/pricing_refresh Refreshes token pricing from models.dev
/tokens_today Tokens used today
/tokens_daily Tokens used in the last 24 hours
/tokens_weekly Tokens used in the last 7 days
/tokens_monthly Tokens used in the last 30 days, with pricing
/tokens_all Tokens used across all local history
/tokens_session Tokens used in this session
/tokens_session_all This session plus its subagent sessions
/tokens_between YYYY-MM-DD YYYY-MM-DD Tokens used between two dates

CLI commands

Command What it does
npx @slkiser/opencode-quota@latest init Set up OpenCode Quota
npx @slkiser/opencode-quota@latest provider add Add or update a custom provider
npx @slkiser/opencode-quota@latest show Show current quota
npx @slkiser/opencode-quota@latest status Check setup and provider problems
npx @slkiser/opencode-quota@latest update Update an existing installation

show and status work with OpenCode closed (how they differ). Add --help to see all options.

Providers

Most providers work automatically once you log in through OpenCode. Needs setup links show the extra step.

Pre-configured American providers

Personal
Provider Auth/setup Data from Reports
Anthropic (Claude) Needs setup Local CLI/OAuth Quota
Chutes AI Automatic Remote API Quota
Cursor Needs setup Local estimate Budget and spend
GitHub Copilot Automatic Remote API Budget and usage
Google AGY Needs setup Remote API Quota
Kilo Gateway Automatic Remote API Quota and balance
NanoGPT Automatic Remote API Quota and balance
Ollama Cloud Automatic Remote API Quota and usage
OpenAI Automatic Remote API Quota
OpenCode Go Automatic Remote API Quota
OpenCode Zen Automatic Remote API Budget and balance
OpenRouter Automatic Remote API Budget and spend
Synthetic Automatic Remote API Quota
xAI SuperGrok Automatic Remote API Quota
Business / Enterprise
Provider Auth/setup Data from Reports
Anthropic (Claude) Needs setup Local CLI/OAuth Quota
Chutes AI Automatic Remote API Quota
Cursor Needs setup Local estimate Budget and spend
Gemini CLI Needs setup Remote API Quota
GitHub Copilot Needs setup Remote API Budget and usage
Google AGY Needs setup Remote API Quota
NanoGPT Automatic Remote API Quota and balance
OpenAI Automatic Remote API Quota
OpenCode Zen Automatic Remote API Budget and balance
OpenRouter Automatic Remote API Budget and spend
Synthetic Automatic Remote API Quota
xAI SuperGrok Automatic Remote API Quota

Gemini CLI works only with Gemini Code Assist Standard or Enterprise (organization) accounts. Personal Google users should use Google AGY.

Pre-configured Chinese providers

Personal
Provider Auth/setup Data from Reports
Alibaba Coding Plan Automatic Local estimate Quota
Alibaba Personal Token Plan Needs setup Official CLI Quota
DeepSeek Automatic Remote API Balance and status
Kimi Code Automatic Remote API Quota
Kimi Code (CN) Automatic Remote API Quota
MiniMax Token Plan Automatic Remote API Quota
MiniMax Token Plan (CN) Automatic Remote API Quota
Xiaomi MiMo Needs setup Dashboard API Quota and balance
Z.ai Coding Plan Automatic Remote API Quota
Zhipu Coding Plan Automatic Remote API Quota
Business / Team
Provider Auth/setup Data from Reports
Kimi Code Automatic Remote API Quota
Kimi Code (CN) Automatic Remote API Quota
MiniMax Token Plan Automatic Remote API Quota
MiniMax Token Plan (CN) Automatic Remote API Quota
Zhipu Coding Plan Automatic Remote API Quota

These show only your own member API key's usage, not the whole organization's.

Custom providers

Track a provider that is not listed, from its quota API or from a local estimate:

npx @slkiser/opencode-quota@latest provider add

It previews the change before saving. See the custom-provider guide.

Troubleshooting

  1. Run /quota_status in OpenCode, or npx @slkiser/opencode-quota@latest status in a terminal.
  2. Provider missing? Log in to it again in OpenCode 2.
  3. Using a companion plugin (Cursor, Google)? List it before @slkiser/opencode-quota in opencode.json.
  4. claude or bl not found? See Service environment.
  5. Token reports empty? Start OpenCode once, then use a model.

More fixes: Troubleshooting.

Reference

Guides: Manual install · Configuration · Providers · Troubleshooting · External integration · Updating safely

Outside links: OpenCode docs · OpenCode config · OpenCode plugins · OpenCode TUI · models.dev pricing data · Node.js downloads

Contributors

Thanks to everyone who has contributed to OpenCode Quota.

License

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

Star History Chart

About

OpenCode quota & tokens usage with zero context window pollution. Supports OpenCode Go, Cursor, GitHub Copilot, OpenAl, Kimi Code, Alibaba Coding Plan, Chutes Al, Google Antigravity, Z.ai Coding Plan and more.

Topics

Resources

Contributing

Stars

985 stars

Watchers

3 watching

Forks

Releases

Contributors

Languages