About this project

# QuotaBar QuotaBar is a lightweight, menu-bar-only utility for macOS 14+ that tracks remaining subscription quotas for several AI coding and chat services. It provides a visual indicator of usage limits for **Cursor**, **ChatGPT** (Plus/Pro), **GLM** (z.ai/BigModel), **Grok** (consumer SuperGrok), and **OpenCode Go**. The app operates discreetly as a dark pill in the status bar, showing a percentage and a small bar chart, with a compact popover for detailed account management. ## Key Features - **Multi-Service Support**: Monitors quota usage for five distinct AI platforms using their unofficial but standard usage endpoints. - **Menu Bar Integration**: Displays a single icon in the macOS status bar with a percentage indicator. The color changes to orange when remaining quota drops below 25%. - **Compact Popover**: A fixed-size popover (320x360) shows detailed cards for each provider or account. It supports scrolling for multiple accounts and includes settings access. - **Multi-Account Management**: Supports multiple accounts for ChatGPT and OpenCode Go. Users can switch between active accounts directly from the popover, with the status bar reflecting the selected account's usage. - **Local Credential Storage**: Secrets are stored securely in the macOS Keychain. Non-secret preferences are saved in `~/.config/quotabar/config.json` with restricted permissions (mode 0600). - **No Telemetry**: The application does not send any usage data or telemetry to external servers beyond fetching the necessary quota information from the respective providers' APIs. - **Privacy-Focused**: Designed as a non-sandboxed `LSUIElement` to allow reading local files (like Cursor's state database) and handling browser cookies without complex entitlements. ## Supported Providers & Methods ### Cursor - Reads authentication tokens from the local Cursor application database (`state.vscdb`) or accepts pasted session cookies. - Fetches usage data from `cursor.com/api/usage-summary`. - Distinguishes between "Cursor Models" and "Other Models" pools. ### ChatGPT (Plus / Pro) - Supports multi-account via the Codex CLI (`codex login`) or manual cookie/JSON input. - Uses the `wham/usage` endpoint to fetch Session, Weekly, and Monthly limits. - Automatically refreshes expired tokens using the public OAuth API if the Codex CLI is available. ### GLM (z.ai / BigModel) - Accepts API keys via Settings or environment variables. - Supports both Global (`api.z.ai`) and China (`open.bigmodel.cn`) regions. - Fetches quota limits from the monitor API. ### Grok (Consumer SuperGrok) - Reads authentication from `~/.grok/auth.json` written by the Grok CLI or accepts pasted OAuth tokens. - Fetches billing and usage data from the Grok CLI proxy API. - Specifically targets consumer SuperGrok plans, not team management APIs. ### OpenCode Go - Multi-account support via API keys stored in the Keychain. - Fetches usage from `opencode.ai/zen/go/v1/usage`. - Converts "used" percentages to "remaining" for display. ## Installation The recommended installation method is via Homebrew: ```bash brew tap ttaatoo/quotabar https://github.com/ttaatoo/quotabar brew install --cask ttaatoo/quotabar/quotabar ``` If Gatekeeper blocks the ad-hoc signed application, you may need to run: ```bash xattr -dr com.apple.quarantine /Applications/QuotaBar.app ``` Then open System Settings > Privacy & Security and click **Open Anyway**. ## Building from Source Requirements: macOS 14+, Xcode 15.4+ (Swift 5.9+). ```bash git clone https://github.com/ttaatoo/quotabar.git cd quotabar open QuotaBar.xcodeproj ``` Run the project in Xcode or build via command line: ```bash xcodebuild -project QuotaBar.xcodeproj -scheme QuotaBar -configuration Release \ MARKETING_VERSION=0.0.13 CURRENT_PROJECT_VERSION=0.0.13 \ CODE_SIGN_IDENTITY="-" CODE_SIGNING_ALLOWED=YES CODE_SIGNING_REQUIRED=NO build ``` ## Disclaimer QuotaBar is an independent, unofficial tool. It interacts with private usage endpoints that may change without notice. It is not affiliated with Cursor, OpenAI, z.ai, BigModel, xAI, or OpenCode. Users are responsible for managing their own credentials and understanding the risks of using unofficial APIs.