A collection of TrafficMonitor plugins that display AI service usage, balances, and quotas directly in the taskbar.
| Plugin | Directory | Description | Status |
|---|---|---|---|
| DeepSeek Balance | DeepSeek/ |
DeepSeek API account balance | ✅ Ready |
| Codex Balance | Codex/ |
OpenAI / Codex CLI usage & balance | ✅ Ready |
| Claude Balance | Claude/ |
Anthropic Claude API usage & cost | ✅ Ready |
| Gemini Balance | Gemini/ |
Google Gemini API usage & cost | ✅ Ready |
| Z.AI Balance | ZAI/ |
Z.AI / Zhipu AI GLM Coding Plan token usage | ✅ Ready |
| MiniMax Balance | MiniMax/ |
MiniMax Token Plan usage | ✅ Ready |
| MiMo Balance | MiMo/ |
Xiaomi MiMo Token Plan info (manual) | ✅ Ready |
Displays your DeepSeek API account balance in the taskbar.
Features:
- Real-time balance display —
¥12.34or$12.34in the taskbar - Configurable refresh interval (1–1440 min)
- Left-click opens DeepSeek billing page
- Native settings dialog for API key & interval
- Zero external dependencies (WinHTTP only)
- Download
DeepSeekBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings to configure API key
Stored in DeepSeekBalance.ini under TrafficMonitor's config directory:
[Settings]
ApiKey=sk-you...-key
FetchInterval=30| 插件 | 查询内容 | 接口类型 | 认证方式 |
|---|---|---|---|
| DeepSeek Balance | 余额 | 官方 API (/user/balance) |
API Key (sk-...) |
| Codex Balance | 累计花费 + 余额 | Dashboard API (优先) + /organization/costs (回退) |
Session Cookie 优先,API Key 回退 |
| Claude Balance | 月累计花费 | 官方 API (/v1/organizations/cost_report) |
Admin API Key (***...) |
| Gemini Balance | 月请求量 | Cloud Monitoring (request_count) |
GCP Service Account JSON |
| Z.AI Balance | Token 使用量 (5h) | 官方配额 API (/api/monitor/usage/quota/limit) |
Coding Plan API Token |
| MiniMax Balance | Token 使用量 (5h) | 官方 API (/v1/token_plan/remains) |
Token Plan Key (tp-...) |
| MiMo Balance | — (手动) | 无公开 API | API Key (可选) |
Displays OpenAI / Codex CLI usage in the taskbar. Two data sources with priority fallback:
Provides month-to-date spend, daily breakdown, and account balance (credits/grants).
Endpoints (internal, undocumented):
GET https://api.openai.com/dashboard/billing/usage
GET https://api.openai.com/dashboard/billing/subscription
How to get the session cookie:
-
In the plugin settings dialog, click 「Get Cookie」 — it opens
https://platform.openai.com/auth/login -
Log in with your OpenAI account
-
After logging in, open Browser Developer Tools (F12):
- Chrome/Edge:
Application→Cookies→https://api.openai.com - Firefox:
Storage→Cookies→https://api.openai.com
- Chrome/Edge:
-
Find the cookie named
__session(orAuth0session cookie) -
Copy its full value
-
Paste it into the Session Cookie field in the plugin settings
The cookie value is long (a JWT token, ~1000+ characters). Make sure you copy the entire string — it starts with
eyJ(base64-encoded JSON) or__session=eyJ... -
Click OK — the plugin will immediately try to fetch your billing data
Troubleshooting:
- Session cookies expire after a few hours to a few days. When you see
ERRand your session was working before, re-do steps 2-6. - If you see
No Auth, no cookie or API key is configured.
If no session cookie is configured, falls back to the official costs API:
GET https://api.openai.com/v1/organization/costs
Provides: month-to-date spend only (no balance/credit info).
| Auth mode | Taskbar example | Budget configured | Balance available |
|---|---|---|---|
| Session + budget | Codex: $47.21 / $120.00 |
✅ Yes | ✅ Yes |
| Session only | Codex: $47.21 | $72.79 left |
❌ No | ✅ Yes |
| API key + budget | Codex: $47.21 / $120.00 |
✅ Yes | ❌ No |
| API key only | Codex: $47.21 |
❌ No | ❌ No |
- Download
CodexBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings to configure auth
Stored in CodexBalance.ini under TrafficMonitor's config directory:
[Settings]
SessionCookie=__session=eyJ... ; Priority 1 (optional)
ApiKey=sk-proj-... ; Priority 2 fallback (optional)
MonthlyBudget=120 ; Optional, for progress display
FetchInterval=30Displays Anthropic Claude API usage cost in the taskbar. Uses the official documented Usage & Cost Admin API.
Auth: Admin API Key (sk-ant-admin-...) — created in Claude Console under Organization Settings.
GET https://api.anthropic.com/v1/organizations/cost_report
Headers: X-Api-Key: sk-ant-admin-...
anthropic-version: 2023-06-01
Returns month-to-date cost in USD. The Cost API is the only official billing endpoint — Anthropic has no balance/credit API (postpaid billing).
| Auth mode | Taskbar example | Budget configured |
|---|---|---|
| Admin Key + budget | Claude: $47.21 / $120.00 |
✅ Yes |
| Admin Key only | Claude: $47.21 |
❌ No |
| No key | No Key |
— |
- Download
ClaudeBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings → enter your Admin API Key
Stored in ClaudeBalance.ini under TrafficMonitor's config directory:
[Settings]
AdminApiKey=sk-ant-admin-...
MonthlyBudget=120
FetchInterval=30Displays Google Gemini API usage in the taskbar. Uses a GCP Service Account to authenticate with Google Cloud Monitoring API — the same approach Google Gemini CLI / agy uses under the hood (OAuth2 via JWT assertion).
- Go to GCP Console → IAM → Service Accounts
- Create a service account → assign Monitoring Viewer role
- Create a JSON key → download
- Open the JSON file in a text editor — copy the entire content
- Paste it into the plugin settings dialog (multiline edit field)
The plugin parses the JSON, generates a JWT, exchanges it for an OAuth2 token, and queries:
GET /v3/projects/{project}/timeSeries
metric.type = generativeai.googleapis.com/request_count
Returns: month-to-date request count (shown as 12.5K req).
| Auth mode | Taskbar example | Budget configured |
|---|---|---|
| Service Account + budget | Gemini: 12.5K req | $120 cap |
✅ Yes |
| Service Account only | Gemini: 12.5K req |
❌ No |
| No key | No Key |
— |
- Download
GeminiBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings → paste GCP Service Account JSON key
Stored in GeminiBalance.ini under TrafficMonitor's config directory:
[Settings]
SaJson={"type":"service_account","project_id":"...","private_key":"[REDACTED PRIVATE KEY]\n","client_email":"...@....iam.gserviceaccount.com",...}
MonthlyBudget=120
FetchInterval=30Displays your GLM Coding Plan token usage in the taskbar. Shows the primary quota (5-hour rolling window) as a fraction of tokens used vs total.
Auth: Coding Plan API Token — create at z.ai after purchasing a Coding Plan subscription.
GET https://api.z.ai/api/monitor/usage/quota/limit
Headers: Authorization: Bearer <token>
Supports two regions:
- International:
api.z.ai(default) - China Mainland:
open.bigmodel.cn
Response provides multiple limit types — the plugin uses TOKENS_LIMIT as the primary display:
{
"data": {
"level": "standard",
"planName": "Coding Plan Pro",
"limits": [{
"type": "TOKENS_LIMIT",
"percentage": 45,
"used": 4500000,
"total": 10000000,
"remaining": 5500000,
"nextResetTime": 1717000000000
}]
}
}| Auth mode | Taskbar example | Description |
|---|---|---|
| API Key only | ZAI: 4.5M/10M |
Used/Total tokens in the 5h window |
| API Key + budget | ZAI: 45% | $30 cap |
Percentage + budget cap |
Note: The GLM Coding Plan is subscription-based (not pay-per-token). Quotas reset on a rolling 5-hour window. The Monthly Budget field is optional — set it to track spending against a cost cap ($).
- Download
ZAIBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings → enter your Coding Plan API key
Stored in ZAIBalance.ini under TrafficMonitor's config directory:
[Settings]
ApiKey=zai-...your-key
Region=0 ; 0=International, 1=China
MonthlyBudget=30
FetchInterval=30Displays your MiniMax Token Plan usage in the taskbar. Shows the request quota in the 5-hour rolling window (used / total).
Auth: Token Plan Key — create at platform.minimax.io under Token Plan subscription.
GET https://api.minimax.io/v1/token_plan/remains
Headers: Authorization: Bearer <token>
Supports two regions:
- International:
api.minimax.io(default) - China:
api.minimaxi.com
Response (note: usage_count fields return remaining, not used):
{
"current_interval_usage_count": 650,
"current_interval_total_count": 1500,
"current_weekly_usage_count": 4200,
"current_weekly_total_count": 7500,
"next_reset_time": 1717000000000
}Used = total - remaining (e.g., 1500 - 650 = 850 requests used).
| Auth mode | Taskbar example | Description |
|---|---|---|
| Token Plan key | MiniMax: 57% |
Usage percentage in 5h window |
| + budget | MiniMax: 57% | $30 cap |
Percentage + budget cap |
- Download
MiniMaxBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings → enter Token Plan key
[Settings]
ApiKey=tp-...your-key
Region=0 ; 0=Intl, 1=China
MonthlyBudget=30
FetchInterval=30Displays your Xiaomi MiMo Token Plan info in the taskbar.
⚠️ No public balance/usage API available. This plugin shows your plan tier and credit limit manually selected in settings. The API Key is optional (used for best-effort undocumented endpoint probe only).
| Tier | Monthly Credits | Annual Credits |
|---|---|---|
| Lite | 60M | 720M |
| Standard | 200M | 2,400M |
| Pro | 700M | 8,400M |
| Max | 1,600M | 19,200M |
Select your plan tier + cycle in the settings dialog to see your plan info in the taskbar.
- Download
MiMoBalance.dllfrom Releases - Copy to
<TrafficMonitor>/plugins/ - Restart TrafficMonitor, enable in Plugin Management
- Right-click → Options / Settings → select your plan tier
[Settings]
ApiKey= ; Optional (best-effort probe)
Region=0 ; 0=PAYG, 1=CN TP, 2=SGP TP, 3=EU TP
Plan=1 ; 0=None, 1=Lite, 2=Standard, 3=Pro, 4=Max
PlanCycle=0 ; 0=Monthly, 1=Annual
MonthlyBudget=30
FetchInterval=30- Windows: Visual Studio 2019+ or CMake + MSVC
- Linux: CMake + MinGW-w64 (for cross-compilation)
mkdir build && cd build
# MSVC
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
# Linux MinGW cross-compile
cmake .. -DCMAKE_TOOLCHAIN_FILE=../mingw-toolchain.cmake
cmake --build .Output: build/plugins/*.dll
Each plugin compiles independently — you can also build a single one by targeting its name (e.g. cmake --build . --target DeepSeekBalance).
PluginInterface.h sits in the project root and is the official TrafficMonitor plugin SDK. All plugins include it from the parent path.
Future shared utility code (JSON parsing, HTTP helpers, etc.) will also live in the root as it gets extracted from individual plugins.
MIT