Track your AI coding assistant usage in one place. This plugin shows both provider quota information and real-time token usage statistics for GitHub Copilot, Claude Code, Z.ai, and GPT Codex.
Note: This plugin requires OpenCode to be installed.
- Requirements
- Quick Start
- What You'll See
- Features
- Configuration Reference
- Troubleshooting
- Development
Before installing this plugin, make sure you have:
- OpenCode installed
- Node.js installed (for local plugin installation)
- API keys/tokens for at least one of the supported services:
- GitHub Copilot account
- Anthropic (Claude) API key
- Z.ai account
- OpenAI account connected in OpenCode (
openaientry inauth.json)
If you haven't already, install OpenCode using one of these methods:
# Quick install (recommended)
curl -fsSL https://opencode.ai/install | bash
# Or using npm
npm install -g opencode-ai
# Or using Homebrew (macOS/Linux)
brew install anomalyco/tap/opencodeChoose one of the following installation methods:
Clone this repository to your project's plugins directory:
cd /path/to/your/project
mkdir -p .opencode/plugins
git clone https://github.com/toninho09/opencode-usage.git .opencode/plugins/opencode-usage
cd .opencode/plugins/opencode-usageTip: For global installation (available in all projects), use:
mkdir -p ~/.config/opencode/plugins
git clone https://github.com/toninho09/opencode-usage.git ~/.config/opencode/plugins/opencode-usage
cd ~/.config/opencode/plugins/opencode-usage
npm installnpm install -g @toninho09/opencode-usage@latestThen add to your opencode.json config file:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@toninho09/opencode-usage@latest"]
}Navigate to your project and start OpenCode:
cd /path/to/your/project
opencodeNow check your usage:
/usage
╔════════════════════════════════════════════════════════════════════════════════╗
║ GITHUB COPILOT ║
╚════════════════════════════════════════════════════════════════════════════════╝
Plan: individual
Premium: [## ] 11% (33/300)
Chat: Unlimited
Completions: Unlimited
Quota Resets: 18d 0h (2026-02-28 21:00 UTC-03:00)
╔════════════════════════════════════════════════════════════════════════════════╗
║ CLAUDE CODE ║
╚════════════════════════════════════════════════════════════════════════════════╝
5 Hour: [### ] 15%
7 Day: [## ] 11%
5h Resets: 4h (2026-02-11 00:59 UTC-03:00)
7d Resets: 6d 1h (2026-02-16 21:59 UTC-03:00)
Extra Usage: Disabled
╔════════════════════════════════════════════════════════════════════════════════╗
║ Z.AI CODING PLAN ║
╚════════════════════════════════════════════════════════════════════════════════╝
Account: xxxxxxxx............ (Z.AI Coding Plan)
Tokens: [ ] 1%
5h Resets: 4h (2026-02-11 00:45 UTC-03:00)
MCP Searches: [ ] 0% (0/100)
╔════════════════════════════════════════════════════════════════════════════════╗
║ GPT CODEX ║
╚════════════════════════════════════════════════════════════════════════════════╝
Plan: PLUS
Primary: [### ] 13%
Secondary: [# ] 4%
Primary Resets: 4h (2026-03-03 21:43 UTC-03:00)
Secondary Resets: 6d 23h (2026-03-10 16:43 UTC-03:00)
Credits: 0
╔════════════════════════════════════════════════════════════════════════════════╗
║ Current Session ║
╚════════════════════════════════════════════════════════════════════════════════╝
Total Tokens: 14,650
Messages: 2
Models:
────────────────────────────────────────────────────────────────────────────
github-copilot/gpt-5-mini
In: 14,190 Out: 460 Rea: 0 Cache-Rd: 0 Cache-Wr: 0 Messages: 2
╔════════════════════════════════════════════════════════════════════════════════╗
║ All Sessions (2 sessions) ║
╚════════════════════════════════════════════════════════════════════════════════╝
Total Tokens: 30,332
Messages: 4
Models:
────────────────────────────────────────────────────────────────────────────
zai-coding-plan/glm-4.7-flash
In: 15,102 Out: 492 Rea: 0 Cache-Rd: 88 Cache-Wr: 0 Messages: 2
github-copilot/gpt-5-mini
In: 14,190 Out: 460 Rea: 0 Cache-Rd: 0 Cache-Wr: 0 Messages: 2
Token Tracking Key:
In= Input tokensOut= Output tokensRea= Reasoning tokensCache-Rd= Cache read tokensCache-Wr= Cache write tokensMessages= Message count
- ✅ Provider quota and usage monitoring: Shows usage limits/usage data for Copilot, Claude, Z.ai, and GPT Codex
- ✅ Real-time token tracking: Automatically monitors token usage from all AI messages
- ✅ Provider/Model breakdown: See usage grouped by AI provider and model
- ✅ Token type tracking: Input, output, reasoning, cache read, and cache write tokens
- ✅ Multi-session support: View current session and all sessions history
- ✅ No external dependencies: Uses only in-memory tracking (reset when app closes)
MIT
Contributions welcome! Feel free to open an issue or pull request.