◆ booting phatdev.net
<PhatLam/>
000%
← All projects
macOS · Developer tools · Privacy

AIUsage

A quota and cost dashboard for AI services on macOS: Claude, ChatGPT/Codex, Antigravity and the Gemini API in one window and one widget. See how much quota is left, when it resets, where it is going and how much money remains, with pace forecasts and stale-data warnings. No intermediary server.

Version 0.8.0, used daily for personal use, not released publicly

AIUsageAIUsage
Role
Product owner, built with Claude Code
Stack
Swift, SwiftUI, WidgetKit, shell and Python
Version
0.8.0 (Oct 23, 2026)
Runs on
macOS 26 or later, with a large widget
4
AI services in one window: Claude, ChatGPT, Antigravity, Gemini API
5 phút
background refresh cycle, within the widget redraw budget
6
independent data sources, one failing never hides the others
0
intermediary servers: the numbers stay on your Mac

Highlights

Read each vendor where it publishes

Claude and AI Studio through a signed-in WebKit view, Codex through the Codex app's own API, Antigravity through the agy command. No reliance on an official API.

Stale numbers look stale

Each source has its own fetch time and its card warns after 90 minutes. The shared clock only advances on a genuinely successful fetch.

Pace forecast

A should-be-here marker on every quota bar and a status line: comfortable, expected to run out tomorrow morning, 5% left.

Know where the quota goes

Analysis of long sessions, large context and subagents for Claude Code and Codex, combining this Mac, Cowork and a remote host.

A widget and a self-fitting window

A large widget with a per-second countdown. A dashboard window that grows to full height, resizes freely and shrinks on small displays.

Screenshots

The dashboard window: Claude, ChatGPT, Antigravity and the Gemini API in one 4-row by 3-column grid of equal cells (sample data)The dashboard window: Claude, ChatGPT, Antigravity and the Gemini API in one 4-row by 3-column grid of equal cells (sample data)
The dashboard window: Claude, ChatGPT, Antigravity and the Gemini API in one 4-row by 3-column grid of equal cells (sample data)
7-day mode: Claude Code, Codex and Gemini analysis accumulated over the week7-day mode: Claude Code, Codex and Gemini analysis accumulated over the week
7-day mode: Claude Code, Codex and Gemini analysis accumulated over the week
What is eating the Claude quota, and Codex CLI: long sessions, large context, subagents, tokens and turn outcomesWhat is eating the Claude quota, and Codex CLI: long sessions, large context, subagents, tokens and turn outcomes
What is eating the Claude quota, and Codex CLI: long sessions, large context, subagents, tokens and turn outcomes
Codex 5-hour limit window by window, and the Gemini API: credit balance, cost by model, end-of-month projectionCodex 5-hour limit window by window, and the Gemini API: credit balance, cost by model, end-of-month projection
Codex 5-hour limit window by window, and the Gemini API: credit balance, cost by model, end-of-month projection
Equal-cell grid charts: Claude by hour, Codex by day and model, Gemini by dayEqual-cell grid charts: Claude by hour, Codex by day and model, Gemini by day
Equal-cell grid charts: Claude by hour, Codex by day and model, Gemini by day

Click an image to enlarge, use the arrow keys to browse.

On this page
  1. The problem
  2. The solution
  3. Compared with doing it by hand
  4. Technology
  5. Built with Claude Code

The problem

A heavy AI user often pays for several services at once: a Claude plan, a ChatGPT plan, an Antigravity plan and the Gemini API billed by usage. Each has its own limits, its own reset cycle and its own web page. To learn "how much can I still use today" you open four or five pages, sign in again when a session expires, and still do not know what the quota is being spent on.

Vendors also offer no official API for reading quota. Some have only a web page, some only a command-line tool, and the format changes with each update.

The solution

AIUsage brings every quota and cost into one window and one widget on macOS, refreshes itself in the background every 5 minutes, and keeps the data on your Mac.

Read each vendor where it publishes

Claude and Google AI Studio only have web pages, so the app reads those pages through a signed-in WebKit view. Codex uses the API the Codex app itself calls. Antigravity is read from the agy command-line tool. The app therefore does not depend on an official API and does not break when a command-line tool updates.

Stale numbers look stale

Each source keeps its own fetch time. After 90 minutes without a refresh the card of that source warns, and the shared clock only advances on a genuinely successful fetch. A failing source is never hidden by the healthy ones.

Pace forecast

Every quota bar has a "should be here" marker for even use across the cycle, with a status line: comfortable, expected to run out tomorrow morning, 5% left. You know whether you are using it fast or slow without doing the arithmetic.

Know where the quota goes

The analysis reads the session logs of Claude Code and Codex on this Mac, in Cowork and on a remote host over SSH. It shows the share of requests that fall into long sessions, large context and subagents, split by model, project and hour. For Codex there is also a 7-day limit history, the remaining reset credits and data from OpenAI's servers.

Money, down to the day

For the Gemini API the app combines Cloud Monitoring, a price table, the BigQuery billing export and the AI Studio Billing page to produce the credit balance, cost by day and by model, an end-of-month projection and the days the balance will last. For Anthropic, the API credit row shows how much is left of the USD 200 the Max plan grants every month.

A widget and a self-fitting window

The large widget stays on the desktop with a countdown. The dashboard window is a 4-row by 3-column grid of equal cells that grows to full screen height, resizes freely and shrinks on a small display.

Compared with doing it by hand

Criterion AIUsage Opening each website A self-updating spreadsheet
Several vendors in one place Yes No Partly
Background refresh Yes, every 5 minutes No Partly
Forecast of when quota runs out Yes No Write your own formulas
Where the quota goes Yes No No
Per-source stale warning Yes Not applicable No
Desktop widget Yes No No
Data stays on your Mac Yes Yes Depends on the tool

Technology

  • Interface: SwiftUI and WidgetKit, Liquid Glass, on macOS 26 or later.
  • Data fetching: shell and Python, one independent run per source, atomic writes to a cache file.
  • Web sign-in: a small WKWebView app that keeps the sign-in session.
  • Background: three LaunchAgents for the scheduled refresh, the refresh button and the sign-in window.

Built with Claude Code

The project is built with Claude Code following the product owner's plan and architecture, with Codex reviewing code and Gemini assisting with the interface. Every interface change is verified with real screenshots, and the widget is measured on an off-screen render instead of being judged by eye.

More projects