Skip to content

Repository files navigation

AIUsageMonitor

AIUsageMonitor Icon

macOS Menu Bar System Monitor

📖 中文版

Release License Swift macOS Version

AIUsageMonitor is a lightweight macOS menu bar system monitor that displays real-time laptop temperature, CPU usage, AI service usage (DeepSeek / Tavily / MiniMax / OpenRouter / Command Code / OpenCode GO), and Hindsight memory stats. Supports auto-refresh and manual refresh.

Prerequisites

The Hindsight dashboard requires two backend services to be running:

1. Hindsight API (port 9077)

The core memory engine. Install and run via pip:

pip install hindsight-api -U
hindsight-api --port 9077

API keys and LLM provider are configured via environment variables. See the Hindsight documentation for details.

2. Hindsight Control Plane (port 9999)

The official web UI for browsing memory banks, searching memories, and managing configuration. Requires Node.js 18+.

# Install globally (one-time)
npm install -g @vectorize-io/hindsight-control-plane

# Run (pointing to your local API)
hindsight-control-plane --api-url http://localhost:9077

The Control Plane starts on port 9999 by default. AIUsageMonitor's native dashboard window loads this URL automatically.

For auto-start on login, both services can be managed via launchd. See scripts/ for example plist files.

Quick Start

Download the latest release from GitHub Releases:

  • AIUsageMonitor.dmg — Universal macOS installer

After installation:

  1. Mount the DMG and drag AIUsageMonitor.app to Applications
  2. Launch AIUsageMonitor
  3. Click the menu bar icon to view data
  4. Configure API keys & workspace URL in Settings

⚠️ If Gatekeeper blocks the app, right-click → Open or allow it in System Settings > Privacy & Security.

Features

  • 🌡️ Temperature Monitor — Real-time battery temp, CPU usage & thermal state
  • 🐋 DeepSeek Balance — Check total, granted & topped-up balance
  • 🔍 Tavily Usage — Monthly quota, used & remaining credits
  • 🌐 OpenRouter Usage — Account balance (total/used/remaining) + today's spend via the Analytics API. Requires a Management Key
  • MiniMax Token Plan — China subscription usage (5h + weekly windows per model family, with countdown reset)
  • 🔄 OpenCode GO — RPC usage % with WKWebView login & browser fallback
  • 🧠 Hindsight Dashboard — Opens native Hindsight Control Plane (port 9999) with official web UI for memory banks, recall, and entity exploration
  • 🌐 Network Speed — Real-time ↓↑ network speed, 3s refresh
  • 🟢 Health Indicator — Color-coded: default/orange/red for health status
  • 🔒 Secure Storage — API keys stored in macOS Keychain
  • ⏱️ Auto Refresh — Configurable refresh interval (1-30 min)
  • 👁️ Show/Hide Cards — Toggle each module's visibility in settings
  • ⚙️ Settings Panel — Visual config for API keys, workspace & refresh

Data Sources

DeepSeek

  • Balance via https://api.deepseek.com/user/balance
  • Daily usage via WebView scraper from https://platform.deepseek.com/usage

Tavily

  • Usage via https://api.tavily.com/usage
  • Shows plan type, monthly limit, used & remaining credits

OpenCode GO

  • Usage via RPC + WKWebView scraping
  • Supports WKWebView embedded login (GitHub / Google OAuth)
  • System browser login as fallback
  • Manual confirmation button on login failure

OpenRouter

  • Balance via https://openrouter.ai/api/v1/credits (requires a Management Key)
  • Today's spend via POST https://openrouter.ai/api/v1/analytics/query (beta Analytics API, grouped by day, UTC-aligned)

FAQ

"Cannot verify developer" on first launch

This build uses ad-hoc signing. Gatekeeper blocks it. Run in terminal:

xattr -dr com.apple.quarantine /Applications/AIUsageMonitor.app

How to add API Key?

Click the menu bar icon → Settings → Paste API Key → Save.

Build

Requires macOS 14+, Xcode 15+.

git clone git@github.com:zdx52/AIUsageMonitor.git
cd AIUsageMonitor
swift build -c release
cp -r .build/release/AIUsageMonitor AIUsageMonitor.app/Contents/MacOS/

Changelog

v1.9.0

  • 🐐 Command Code usage card — New menu bar card showing GOAT (or Pro/Max) subscription usage: monthly credit remaining vs. $70 cap with progress bar, 5-hour and weekly rolling window meters with reset countdowns, and current billing period total cost / request count / tokens. Uses the same API key as the CLI (internal /alpha/* endpoints: whoami, billing/credits, billing/subscriptions, usage/summary)
  • 🎛️ Settings — Added "Command Code 用量" toggle + API Key input

v1.8.0

  • 🌐 OpenRouter Usage card (re-added) — Menu bar card showing account balance (total credits / used / remaining) from the /api/v1/credits endpoint, plus today's spend from the beta Analytics API (/api/v1/analytics/query), grouped by day. Requires an OpenRouter Management Key in Settings
  • 🎛️ Settings — Added "OpenRouter 用量" toggle + Management Key input

v1.7.0

  • MiniMax Token Plan card — New menu bar card showing China subscription usage per model family (general / video): 5h rolling window + weekly window with progress bars (used %) and "重置于 X 小时之后" reset countdowns. Requires subscription Key (eyJ...) in Settings, separate from the pay-as-you-go API Key
  • 🎛️ Settings — Added "MiniMax Token Plan" + "show video model" toggles
  • 🗑️ Removed OpenRouter — Card, service, settings panel and toggle all removed (unused dead code)

v1.6.0

  • 📖 Novel Writing Web UI integrated — New "小说" (Novel) button next to the dashboard launches the built-in Flask web UI (port 8080) in a native window; the web/ app is now maintained in this repo
  • 🚀 Auto service startup — Clicking the button detects and starts the novel web service (web/.venv) automatically; cleaned up on app exit
  • 🎨 UI polish — Gradient book covers (real cover images from 封面/ take priority), overview hero with SVG word-count chart (hover details) + quality summary, character avatar cards, world/outline/tracking card layouts, pill badges, macOS glassmorphism, evenly spaced menu bar buttons

v1.5.3

  • 🧹 Cleaner status bar — Removed CPU usage percentage from menu bar title, keeping temperature + network speed only
  • 🧠 Hindsight native dashboard — Replaced embedded web proxy with native Hindsight Control Plane (port 9999)
  • 🗑️ Cleanup — Removed old hindsight-server.py and hindsight-dashboard.html resources
  • 📋 Prerequisites documented — Added setup guide for Hindsight API + Control Plane services

v1.5.1

  • 🧹 Simplify mental model page — Removed category filters, only show "全部" (All) view
  • 🐛 Minor fixes — Streamlined mental model list UI

About

macOS menu bar system & AI usage monitor — temperature, network speed, DeepSeek/Tavily/MiniMax/OpenRouter/Command Code/OpenCode GO usage, Hindsight dashboard.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages