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

uv tool install aiquota      # or: pipx install aiquota
aiquota install-widget       # macOS: adds the menu bar + desktop widgets

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
ElevenLabs No third-party OAuth; a user-created API key is the supported route. elevenlabs.io
GitHub Copilot Reuses your existing gh CLI login, which you performed yourself. docs.github.com

Manual entry

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

Gemini, Higgsfield, Lovable, 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
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

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.

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.2.1.tar.gz (148.3 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.2.1-py3-none-any.whl (142.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiquota-0.2.1.tar.gz
Algorithm Hash digest
SHA256 874ea5e6a8d952932a5fdc4d8629e4b8587561b25722ad8d408701c39a347844
MD5 9fe65d96eafc8882368dcec6910b88cf
BLAKE2b-256 bcf12e252109b45c8795b9d716ff09f708cf995f3492bdcf0958c68fb933ddb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiquota-0.2.1.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.2.1-py3-none-any.whl.

File metadata

  • Download URL: aiquota-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 142.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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 495ede51a36dde85f2cf8c28cda077b9c5317d8a003097bbf6538685a824bb59
MD5 af76bffc4068aa764826cd9f75be9fcb
BLAKE2b-256 56d12126ac0e718dcac0ebf0a47005aa7e8f4d6ae48beadc3ec123a33b9ec557

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiquota-0.2.1-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

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.1 This release

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