Skip to content

Likhixang/AILiv

Repository files navigation

AILiv — AI usage monitors for your Windows taskbar

A collection of TrafficMonitor plugins that display AI service usage, balances, and quotas directly in the taskbar.

Plugins

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

DeepSeek Balance

Displays your DeepSeek API account balance in the taskbar.

Features:

  • Real-time balance display — ¥12.34 or $12.34 in 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)

Installation

  1. Download DeepSeekBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings to configure API key

Configuration

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 (可选)

Codex Balance

Displays OpenAI / Codex CLI usage in the taskbar. Two data sources with priority fallback:

Priority 1 — Session Cookie (full billing access)

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:

  1. In the plugin settings dialog, click 「Get Cookie」 — it opens https://platform.openai.com/auth/login

  2. Log in with your OpenAI account

  3. After logging in, open Browser Developer Tools (F12):

    • Chrome/Edge: ApplicationCookieshttps://api.openai.com
    • Firefox: StorageCookieshttps://api.openai.com
  4. Find the cookie named __session (or Auth0 session cookie)

  5. Copy its full value

  6. 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...

  7. 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 ERR and your session was working before, re-do steps 2-6.
  • If you see No Auth, no cookie or API key is configured.

Priority 2 — API Key (fallback)

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).

Display modes

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

Installation

  1. Download CodexBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings to configure auth

Configuration

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=30

Claude Balance

Displays 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.

API

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).

Display

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

Installation

  1. Download ClaudeBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings → enter your Admin API Key

Configuration

Stored in ClaudeBalance.ini under TrafficMonitor's config directory:

[Settings]
AdminApiKey=sk-ant-admin-...
MonthlyBudget=120
FetchInterval=30

Gemini Balance

Displays 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).

Auth setup (one-time)

  1. Go to GCP Console → IAM → Service Accounts
  2. Create a service account → assign Monitoring Viewer role
  3. Create a JSON key → download
  4. Open the JSON file in a text editor — copy the entire content
  5. 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).

Display

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

Installation

  1. Download GeminiBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings → paste GCP Service Account JSON key

Configuration

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=30

Z.AI / Zhipu AI Balance

Displays 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.

API

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
    }]
  }
}

Display

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 ($).

Installation

  1. Download ZAIBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings → enter your Coding Plan API key

Configuration

Stored in ZAIBalance.ini under TrafficMonitor's config directory:

[Settings]
ApiKey=zai-...your-key
Region=0                        ; 0=International, 1=China
MonthlyBudget=30
FetchInterval=30

MiniMax Balance

Displays 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.

API

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).

Display

Auth mode Taskbar example Description
Token Plan key MiniMax: 57% Usage percentage in 5h window
+ budget MiniMax: 57% | $30 cap Percentage + budget cap

Installation

  1. Download MiniMaxBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings → enter Token Plan key

Configuration

[Settings]
ApiKey=tp-...your-key
Region=0                        ; 0=Intl, 1=China
MonthlyBudget=30
FetchInterval=30

MiMo Balance

Displays 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).

Plans

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.

Installation

  1. Download MiMoBalance.dll from Releases
  2. Copy to <TrafficMonitor>/plugins/
  3. Restart TrafficMonitor, enable in Plugin Management
  4. Right-click → Options / Settings → select your plan tier

Configuration

[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

Building All Plugins

Prerequisites

  • Windows: Visual Studio 2019+ or CMake + MSVC
  • Linux: CMake + MinGW-w64 (for cross-compilation)

From source

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).

Shared SDK

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.

License

MIT

About

TrafficMonitor AI plugin collection — live AI usage monitoring in your taskbar

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors