Built a menu-bar usage bar for Claude — no public usage API, open to a better approach
I built a small macOS menu-bar indicator showing how close I am to my Codex and Claude limits.
Codex was easy — it writes real rate_limits into its session logs, so I just read them. For Claude I couldn't find a supported way to get usage, so I ended up calling the undocumented /api/oauth/usage endpoint with the OAuth token from the macOS Keychain. It works great — exact 5h, weekly, and even per-model (it correctly caught my Fable weekly maxed while other models still had room) — but I doubt this is how you'd want people doing it, and it breaks the moment that endpoint changes.
Not a complaint, and I'm happy to change my approach. Really I just want two things:
- A documented, stable usage API so I'm not sitting on an undocumented endpoint.
- That it includes the 5-hour window and per-model limits (the two most useful, and the ones hardest to get otherwise).
Everything else I'm happy to build on top of that myself. Open-source if it's a useful reference: https://github.com/katyani-clave-ai/ai-usage-bar