Track AI usage quotas from your iPhone, with an optional home-screen widget.
- no app backend
- provider requests are in
Shared/ProviderAPIClients.swift - the app saves credentials in the iOS Keychain (
AiUsage/Auth/CredentialsStore.swift). The widget uses access tokens shared by the app to refresh usage.
| Provider | Auth method |
|---|---|
| OpenAI Codex | OAuth or session cookie |
| Claude (including Fable when reported by your plan) | OAuth token or session cookie |
| Grok | Grok account sign-in with a device code |
| Gemini | Import the five-hour and weekly limits from Safari. Eligible legacy Code Assist accounts use OAuth for Code Assist quotas. |
| GitHub Copilot | Personal access token |
| Kimi | Session cookie |
- Xcode 26.2+
- iPhone or simulator on iOS 26.2+
- Apple Developer account (free personal team works)
- Clone this repo and open
AiUsage.xcodeproj. - Plug in your iPhone (or use wireless debugging), then select it as the run destination.
- In Targets, open
AiUsage,AiUsageWidgetExtension, andGeminiSafariSync:- Signing & Capabilities → set your Team
- keep Automatically manage signing enabled
- If signing fails, make IDs unique to your team:
- bundle IDs for all three targets, with extension IDs prefixed by the app ID
Config/AiUsageWidget-Info.plist(WKAppBundleIdentifier)- App Group in
Config/AiUsage.entitlements,Config/AiUsageWidget.entitlements, andShared/GeminiWebUsage.swift
- On first device run, enable Developer Mode on iPhone if prompted.
- Press Run (
Cmd+R). Xcode installs directly to your phone.
- Open Settings (gear icon).
- Pick a provider and follow the inline sign-in instructions. For Grok, tap Sign in with Grok, approve the device code on xAI’s sign-in page, then return to the app.
- Tap Refresh All Providers.
- To see usage on your Home Screen, add the AI Usage widget and choose the provider in widget settings.
- In iPhone Settings → Apps → Safari → Extensions, enable AI Usage Gemini Sync.
- Open Gemini Usage Limits in Safari and sign in. In Safari’s Page Menu, open AI Usage Gemini Sync and allow access to
gemini.google.comif prompted. - Use Sync Gemini Quota in AI Usage settings or tap the Gemini Usage widget. The tap opens the signed-in Safari page for one quota read. The app and widget show the saved reading until the next sync.
Add Gemini Usage from the widget gallery for a standalone small widget. An existing small AI Usage widget can also show Gemini via Edit Widget → Small Provider → Google Gemini. Medium and large widgets include Gemini after the first sync when its Widget toggle is on under Provider Order.
Tap Sync Antigravity Quota under AI Usage → Settings → Google Gemini, or tap the refresh icon on the Antigravity card. The Antigravity row in a widget opens the same sync. On first use, sign in to Antigravity Models & Usage. In Safari’s Page Menu, open AI Usage Gemini Sync and allow access to antigravity.google.com if prompted. The extension reads the quota percentages and the reset times Antigravity displays. Return to AI Usage to see the new reading.
You can also export a report from a Mac signed in to the Antigravity CLI:
agy -p /usage --output-format json > antigravity-usage.jsonPut the JSON file in Files on your iPhone, then choose Import Antigravity Usage in the same settings section. The dashboard and Gemini widget show the latest successful reading. Sync Gemini Quota switches the display back to the two Gemini Apps bars.
- In Xcode: Product → Scheme → Edit Scheme...
- Select Run → Arguments.
- Under Environment Variables, add:
- Name:
DEBUG_UI - Value:
true(also accepts1,yes,on)
- Name:
- Run the app. Debug toggles appear in Settings.
To disable it, uncheck/remove DEBUG_UI (or set it to false).
- Add provider metadata in
Shared/ProviderID.swift(case, name, icon, bar labels, URLs). - Add API client + factory mapping in
Shared/ProviderAPIClients.swift. - Update credential parsing/display/validation in
AiUsage/AppModel.swift(parseCredentialsInput,hasToken,displayToken, refresh logic if needed). - Update provider setup UI copy in
AiUsage/ContentView.swift(tokenPlaceholder,emptyTokenMessage,signInInstructions). - Add icon asset in
Shared/ProviderAssets.xcassets. - Update widget enums/rendering in
AiUsageWidget/AiUsageWidget.swift(ProviderOption,widgetBars). - Add mock entries in
Shared/MockSnapshots.swiftandShared/MockSnapshotsSecondary.swift.
If your provider needs extra credential fields, extend Shared/Credentials.swift (ProviderCredentials).
MIT. See LICENSE.


