ai-limits is a small native Windows tray app for watching AI-provider usage and quota signals without opening dashboards.
It is built for people who switch between ChatGPT, Claude, Z.ai, OpenRouter and OpenCode Zen and want one compact status popup, diagnostics log, and quick refresh loop.
- Native Win32 tray application — no Electron, no web runtime.
- Dark compact popup inspired by modern developer tooling.
- Provider checks for:
- OpenAI ChatGPT
- Antropic Claude
- Z.ai GLM
- OpenRouter
- OpenCode Zen
- Configurable refresh interval: 1, 2, 5, 10, 30, 60 or 180 minutes.
- Configurable log level from Settings.
- Clickable Open logs action in the popup and Settings.
- API keys are encrypted with Windows DPAPI before they are written to config.
- Network diagnostics include WinHTTP stage/error information and provider response context.
The app lives in the Windows notification area. Left-click the tray icon to open the status popup, right-click it for the dark context menu.
| Provider | Credential source | Notes |
|---|---|---|
| OpenAI ChatGPT | Codex browser auth at %USERPROFILE%\.codex\auth.json |
Sign in with Codex in the browser first. ai-limits reads the local auth file. |
| Antropic Claude | API key in Settings | Claude availability depends on rate-limit headers returned by the API. Full response context is written to the log for debugging. |
| Z.ai GLM | API key in Settings | If the account has no coding plan, the popup reports that state instead of a generic parse error. |
| OpenRouter | API key in Settings | OpenRouter may omit limit data for some keys/accounts; the popup reports that explicitly. |
| OpenCode Zen | Built-in probe | The endpoint exposes availability, not a numeric quota. |
Log file:
%APPDATA%\ai-limits\ai-limits.log
Use the Open logs link in the popup header or the Open logs button in Settings.
Log levels: Trace, Debug, Info, Warn, Error, Off.
When a provider shows an unexpected status, attach the relevant log fragment. Network failures include the WinHTTP stage and GetLastError code, for example WinHttpSendRequest failed, GetLastError=12002.
Config is stored in the application profile directory under %APPDATA%\ai-limits.
API keys are encrypted with Windows DPAPI. The encrypted values are machine/user-bound and are not portable to another Windows account.
- Windows 10/11
- Visual Studio 2022 Build Tools
- C++ Build Tools workload
- Windows SDK
- CMake/Ninja from Visual Studio Build Tools
Plain cmake and ninja may not be available in PATH. The repository includes build.ps1, which initializes the Visual Studio environment through VsDevCmd.bat and uses the CMake bundled with Build Tools.
powershell -ExecutionPolicy Bypass -File .\build.ps1powershell -ExecutionPolicy Bypass -File .\build.ps1 -Config Releasepowershell -ExecutionPolicy Bypass -File .\build.ps1 -Clean.\build\ai-limits.exeThe project currently has no registered CTest tests:
No tests were found!!!
The current verification gate is a clean Debug build plus a smoke start of build\ai-limits.exe.
src/
providers/ Provider-specific quota probes
config.* Config load/save and provider metadata
http.* WinHTTP wrapper with diagnostic errors
log.* File logger and OutputDebugString mirror
main.cpp Tray app orchestration and worker checks
popup.cpp Status popup UI
settings.cpp Settings UI
resources/
app.rc Windows resources
icon.ico EXE/tray icon
build.ps1 Visual Studio Build Tools build wrapper
Windows Explorer aggressively caches icons. After a clean rebuild, restart Explorer or test the executable in a fresh folder if the old small icon is still visible.
The app is still running. Exit it from the tray menu or stop the process:
Get-Process ai-limits -ErrorAction SilentlyContinue | Stop-Process -ForceThen rebuild.
Sign in with Codex in the browser first. ai-limits expects:
%USERPROFILE%\.codex\auth.json
After signing in, refresh ai-limits.
MIT. See LICENSE.