Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-limits

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.

Highlights

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

Screens

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.

Providers and credentials

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.

Logs

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.

Configuration

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.

Build from source

Requirements

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

Debug build

powershell -ExecutionPolicy Bypass -File .\build.ps1

Release build

powershell -ExecutionPolicy Bypass -File .\build.ps1 -Config Release

Clean build

powershell -ExecutionPolicy Bypass -File .\build.ps1 -Clean

Run

.\build\ai-limits.exe

Test status

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

Project structure

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

Troubleshooting

The executable icon did not change

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.

Build fails with ai-limits.exe: Access is denied

The app is still running. Exit it from the tray menu or stop the process:

Get-Process ai-limits -ErrorAction SilentlyContinue | Stop-Process -Force

Then rebuild.

ChatGPT shows an auth error

Sign in with Codex in the browser first. ai-limits expects:

%USERPROFILE%\.codex\auth.json

After signing in, refresh ai-limits.

License

MIT. See LICENSE.

About

Native Windows tray app for monitoring AI provider limits and quota signals

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages