Skip to main content

aiquota

PyPI Python License

See how much of every AI subscription you've used — in one place.

Checking whether you're about to hit a limit means opening Claude's settings, then ChatGPT's, then whatever else you pay for. aiquota puts every quota in one widget, one menu bar item, and one command.

aiquota desktop widget showing Claude and ChatGPT usage

$ aiquota

Claude  [live]
  5-hour session     █████████░░░░░░░░░░░░░░░  37.0%  resets Wed 20:30
  Weekly (all)       █████░░░░░░░░░░░░░░░░░░░  22.0%  resets Mon 00:30
  binding: five_hour · overage: rejected

ChatGPT  ChatGPT (team)  [live]
  5-hour             ███████████████░░░░░░░░░  64.0%  resets Wed 18:34
  7-day              ███████░░░░░░░░░░░░░░░░░  28.0%  resets Tue 11:39
  • Sign in, don't paste keys. Pick a platform and its own login page opens. You choose the account; aiquota never sees a password.
  • No dependencies. Pure Python stdlib, so pip install can't break.
  • Never invents a number. Every card is tagged live, manual, or error. If a provider exposes no counter, it says so instead of showing a plausible percentage.
  • Respects provider terms. Where a provider forbids third-party sign-in, aiquota won't offer it — and tells you why, with a link to the policy.

Install

brew install anujpatel06/aiquota/aiquota

Then pick a surface:

aiquota                      # the CLI, works anywhere
aiquota install-widget       # macOS menu bar + desktop widgets
aiquota serve                # localhost HTTP API for your own tools

There's also a native menu bar app that needs no SwiftBar or Übersicht:

bash scripts/build_app.sh && open dist/AIQuotaBar.app

It shells out to the same CLI, so the honesty rules hold in one place.

Or from PyPI: uv tool install aiquota / pipx install aiquota / pip install aiquota.

Then click + Add an AI account in the widget and sign in.

Other ways
pip install aiquota                 # into the current environment
pip install git+https://github.com/anujpatel06/aiquota   # latest main

uv tool / pipx are recommended because they put aiquota on your PATH without touching your project environments.

The widgets need one of these host apps — install-widget tells you which is missing rather than failing quietly:

brew install --cask swiftbar    # menu bar
brew install --cask ubersicht   # desktop

Install just one with aiquota install-widget menubar or … desktop.

Python 3.8+, no dependencies. The CLI runs anywhere; the widgets are macOS only, and install-widget says so instead of pretending on Linux.

Quick start

aiquota link      # see what's on your machine, choose what to track
aiquota           # show everything

link is the only way an account gets connected. It lists credentials it can see — which account, from which file — and links nothing until you pick one and confirm. Nothing is read or sent before that.

$ aiquota link

Add an AI account

Nothing is read until you choose it.

  [1]    ChatGPT / Codex          ● live  ✓ tracked
         Codex/Work windows + credits (NOT general chat quota)
         ✓ found: Codex CLI login (auth_mode: chatgpt), account 2754df98…

  [2]    Claude                   ● live
         Pro/Max 5-hour + weekly windows, reset times
         needs: Claude Code login, or an OAuth token

  [3]    Cursor                   ◐ manual for now
         Request quota is shown in-app; no documented API yet

  [7]    Gemini                   ○ manual
         No consumer quota API; AI Studio shows API-tier limits only

  ... 16 platforms total ...

  [17]   Something else…          ○ manual
         any AI service not listed above

Add which? (number, or Enter to cancel):

The badges are honest about what you'll actually get:

Badge Meaning
● live An adapter fetches real usage once you link a credential
◐ manual for now An endpoint likely exists; no adapter written yet — PRs welcome
○ manual No usage API exists; you enter the numbers

Most AI platforms publish no consumer usage API at all. Listing them as manual is deliberate — a browsable list of everything you pay for beats a short list of only what can be automated.

Useful variants:

aiquota link --list      # just browse, change nothing
aiquota link cursor      # jump straight to one platform
aiquota unlink chatgpt   # stop using the credential, keep the service

Adding accounts

Click + Add an AI account… in the menu bar or desktop widget and a native macOS list appears with every supported platform:

●  ChatGPT / Codex  —  live usage  ✓ added
●  Claude           —  live usage  ✓ added
◐  Cursor           —  manual for now
◐  ElevenLabs       —  manual for now
◐  GitHub Copilot   —  manual for now
◐  OpenRouter       —  manual for now
○  Gemini           —  manual entry
○  Grok             —  manual entry
○  Higgsfield       —  manual entry
○  Midjourney       —  manual entry
○  Perplexity       —  manual entry
○  Runway           —  manual entry
○  Suno             —  manual entry
○  v0 / Lovable / Replit …
+  Something else…

Pick one and it walks you through the rest. No terminal required — though aiquota link gives the same flow in the shell if you prefer.

The badges say what you actually get:

Badge Meaning
● live Real usage, fetched once you link a credential
◐ manual for now An endpoint likely exists; no adapter yet — PRs welcome
○ manual No usage API; you enter the numbers

Most AI platforms publish no consumer usage API. Listing them as manual is deliberate — seeing everything you pay for in one place beats seeing only the two that can be automated.

Usage

aiquota                      # status for everything (default command)
aiquota claude               # just one service
aiquota --json               # machine-readable
aiquota --compact            # one line, for a status bar
aiquota --html ~/quota.html  # write a widget
aiquota -r                   # bypass the cache
aiquota doctor               # diagnose configuration problems

Managing services

aiquota list                       # what you're tracking
aiquota add midjourney --adapter manual --plan "Standard"
aiquota set midjourney credits=120 credits_total=900
aiquota disable chatgpt            # keep config, hide the card
aiquota enable chatgpt
aiquota remove midjourney          # asks first
aiquota rm midjourney -y           # don't ask
aiquota rm a b c -y                # several at once

remove also purges that service's cache entry, so a deleted card can't reappear from stale data.

Tracking a service with no API

Most AI subscriptions expose nothing. Track them anyway — no code required:

aiquota add higgsfield --adapter manual --plan "Creator" \
    --set credits=420 --set credits_total=1500 --set renews_on=2026-10-01

# or as a used/limit pair with your own unit
aiquota add notebooklm --adapter manual \
    --set used=140 --set limit=900 --set unit_label="Notebooks"

These render as manual, so you're never fooled into thinking a hand-typed number was fetched live.

Supported platforms

How you connect each one depends on what the provider allows.

Sign in with your account

Click the platform, its own login page opens, you pick the account. No API key, no password shown to aiquota.

Platform What you get
Cursor Request quota for the billing period (sign in)
Grok Subscription tier (sign in)
OpenRouter Credit balance and spend (official API)
Perplexity Pro search quota (sign in)
Runway Credit balance (sign in)

Uses a credential you already have

These providers restrict third-party sign-in, so aiquota reads a credential you created yourself — and asks first.

Platform Why not sign-in Source
ChatGPT / Codex Codex CLI's login is issued to Codex. developers.openai.com
Claude Anthropic restricts OAuth to Claude Code and its own applications. code.claude.com
DeepSeek Documented balance endpoint; you create the key. api-docs.deepseek.com
ElevenLabs No third-party OAuth; a user-created API key is the supported route. elevenlabs.io
fal.ai Documented billing endpoint; you create the key. docs.fal.ai
GitHub Copilot Reuses your existing gh CLI login, which you performed yourself. docs.github.com
HeyGen Documented remaining-quota endpoint; you create the key. docs.heygen.com
Kling Documented account costs endpoint; you create the key. app.klingai.com
Leonardo.ai Documented /me endpoint returns token balance; you create the key. docs.leonardo.ai
Poe Documented points-balance endpoint; you create the key. creator.poe.com
Recraft Documented users/me endpoint; you create the key. www.recraft.ai
Z.ai Documented quota endpoint with 5h/weekly/monthly windows. docs.z.ai

Manual entry

No reachable usage endpoint — probed and confirmed, not assumed. You enter the numbers and they're labelled manual.

Descript, Gemini, Higgsfield, Lovable, Luma, Replit, v0.

Deliberately not read

These have working endpoints. aiquota refuses to use them, because the provider prohibits automated access and enforces it. A quota number isn't worth someone's account.

Platform Why Source
Bolt.new StackBlitz terms forbid access by "automated tool (e.g., robots, spiders)". bolt.new
Midjourney Midjourney prohibits automated access outright — "automating interactions with Midjourney service is strictly prohibited", listed as one of four Community Guidelines rules, enforced with account blocks. aiquota will not read it for you. docs.midjourney.com
Suno Suno's terms forbid "any data mining, robots, scraping, or similar data gathering or extraction methods" (clause 13). Reading the billing endpoint on a schedule is exactly that. suno.com
Udio Terms forbid "any automated process of any sort to query, access, retrieve, scrape, data-mine" the service. www.udio.com

Anything not listed: choose "Something else…" in the picker.

If you know a real endpoint for a manual entry, that's the most valuable PR you can send — see CONTRIBUTING.md.

Important caveats

Read these before trusting a number.

  • Most of these endpoints are undocumented. They are the ones each vendor's own client calls, and they can change without notice. aiquota has no affiliation with any provider listed.
  • Claude prefers a free read. The adapter calls the read-only /api/oauth/usage endpoint first. If your token lacks the user:profile scope (tokens from claude setup-token do), it falls back to reading rate headers from a 1-token Haiku call and says so in read_via. Results are cached for 5 minutes — raise --ttl if you poll often.
  • ChatGPT covers the Codex/Work meter, not general chat. Your normal conversation quota has no reachable endpoint. Nothing here can show it.
  • ChatGPT Plus ≠ OpenAI API. Separate products, separate billing. The documented /v1/usage endpoints report API spend and know nothing about a Plus subscription.

Credentials

aiquota never uses a credential you haven't linked. Run aiquota link to see what's available and choose. It will find logins belonging to other apps (Claude Code, Codex CLI, Hermes) but will not touch them until you say so.

Adapter Can link from
claude AIQUOTA_CLAUDE_TOKEN / ANTHROPIC_TOKEN env, ~/.claude/.credentials.json, ~/.hermes/.env
chatgpt AIQUOTA_CODEX_TOKEN env, ~/.codex/auth.json

Env vars and tokens you put in the config are used directly — you set those deliberately. Reading another application's credential file always requires link (or autodiscover=true). Set AIQUOTA_NO_AUTODISCOVER=1 to block it entirely. Config lives at ~/.config/aiquota/config.json, chmod 0600.

Writing an adapter

Drop a .py file in ~/.config/aiquota/adapters/ — no fork, no reinstall:

from aiquota import Adapter, Result, Window, register, LIVE

@register
class MyServiceAdapter(Adapter):
    name = "myservice"                    # config key
    service = "My Service"                # display name
    summary = "What this reads"           # shown by `aiquota adapters`
    setup = "Set MYSERVICE_TOKEN"         # shown when unconfigured

    def probe(self, conf):
        return Result(
            name=self.name, service=self.service, tier=LIVE,
            windows=[Window(label="Monthly", used_pct=42.0,
                            resets_at="Nov 1")],
        )

Then aiquota add myservice. The contract:

  • Never raise. Catch your errors and return tier=ERROR with a readable message. A broken adapter must not take down the whole run (there's a test for this).
  • Be honest about tierLIVE only for numbers you actually fetched.
  • Declare cost_note if probing spends quota or money.

PRs adding adapters are welcome.

Scripting

# warn when any window passes 80%
aiquota --exit-code --threshold 80 || notify-send "AI quota running low"

# tmux status bar
set -g status-right '#(aiquota --compact)'

--json gives you {generated_at, services: [{name, service, plan, tier, windows: [{label, used_pct, resets_at}], extra}]}.

Desktop widgets

Keep it on screen instead of typing a command:

  • Menu bar (SwiftBar/xbar) — AI 46% at the top of the screen, over every app
  • Desktop (Übersicht) — a panel drawn on the wallpaper

Both live in widgets/ with install steps.

Development

python3 -m unittest discover -s tests -v    # 31 tests, no network, ~0.2s

Tests set AIQUOTA_NO_AUTODISCOVER=1 so they never pick up real credentials.

Prior art

CodexBar (MIT) is the most complete tool in this space — 69 providers, native Swift, a plugin runtime. Three of its ideas are in aiquota, adapted rather than copied:

  • Adaptive refresh. Its AdaptiveRefreshPolicyCore widens the poll interval as attention fades. aiquota mirrors the shape of that table.
  • Structured failures. Its plugin API makes every failure a typed reason rather than a string, so the UI can offer a fix.
  • Confidence, separate from source. Its dataConfidence field says how precise a number is, independent of where it came from.

CodexBar's tagline is "every AI coding limit". aiquota covers creative and consumer subscriptions too, and names the providers it refuses to read.

Also worth knowing: ccusage for Claude Code cost history, and openusage for a native menu bar with a local HTTP API.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiquota-0.5.0.tar.gz (205.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiquota-0.5.0-py3-none-any.whl (197.3 kB view details)

Uploaded Python 3

File details

Details for the file aiquota-0.5.0.tar.gz.

File metadata

  • Download URL: aiquota-0.5.0.tar.gz
  • Upload date:
  • Size: 205.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aiquota-0.5.0.tar.gz
Algorithm Hash digest
SHA256 fc734c63e2bd965613eaf264c4240a98803e7de2ab0dd558bd8862a9139f9d96
MD5 8f572f662ea1ea0e426010efdbb314f8
BLAKE2b-256 ea5a018100c0cfa923e4b7d451691c0a0f7dc906c0da8693881cd2db1dacbe7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiquota-0.5.0.tar.gz:

Publisher: publish.yml on anujpatel06/aiquota

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiquota-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: aiquota-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 197.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aiquota-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1296328c1c807c0efabe2f0c6f45e141cbf773bc77f876399f2fe155f8c6509
MD5 434633f1892b27af629052e81975af68
BLAKE2b-256 6833e3ed2b4bb4597aee2edcb72d1d2e9b1fd489dc842e504eff66c9f2c3ca02

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiquota-0.5.0-py3-none-any.whl:

Publisher: publish.yml on anujpatel06/aiquota

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.1

2 files

This release

0.5.0 This release

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page