{"slug": "see-what-s-left-of-your-flat-rate-ai-subscriptions-every-time-you-open-a-termina", "title": "See what's left of your flat-rate AI subscriptions every time you open a termina", "summary": "Developer Francesco Bianco released AIQuota, a single POSIX sh script that needs only awk and curl to display remaining quota for flat-rate AI subscriptions such as ChatGPT, Claude, Copilot, Gemini, OpenCode and Freebuff in a terminal status band and title bar. The tool shows a green, yellow or red dot per account based on the tightest window — green from 50% left, yellow from 20%, red below that — and installs to ~/.local/bin via a curl-piped install.sh that adds one line to the shell startup file. AIQuota reads from a cache so opening a terminal never waits on the network, and it degrades through seven detail levels on narrow terminals, down to hiding the last accounts as '+2'.", "body_md": "**See what's left of your AI subscriptions every time you open a terminal.**\n\nChatGPT nearly out until 3 pm? Open Claude instead. AIQuota tells you before you start the coding agent, not halfway through a task.\n\n- **A status band when a terminal opens** : one section per account, with a green, yellow or red dot showing how close it is to its limit\n- **In the title bar** , always visible and refreshed in the background\n- **Your accounts, your order** : only the ones you list are shown or queried\n- **Instant** : opening a terminal never waits for the network\n- **Tiny and portable** : one POSIX`sh` script that needs only`awk` and`curl`\n\nList your accounts in the order you want them:\n\n```\ncurl -fsSL https://raw.githubusercontent.com/francescobianco/aiquota/main/install.sh | sh -s -- --display=codex,claude,copilot,freebuff\n```\n\nThen open a new terminal. This installs the script to `~/.local/bin` and adds one line to your shell's\nstartup file. To change the accounts or their order, run it again; the line is replaced, not duplicated:\n\n```\naiquota install --display=claude,codex\n```\n\nPrefer to do it by hand? Put `bin/aiquota` in your `PATH` and add this as the **last** line of your startup file:\n\n| Shell | File | Line | \n|---|---|---|\n| bash | `~/.bashrc` | `eval \"$(aiquota init bash --display=codex,claude)\"` | \n| zsh | `~/.zshrc` | `eval \"$(aiquota init zsh --display=codex,claude)\"` | \n| fish | `~/.config/fish/config.fish` | `aiquota init fish --display=codex,claude \\| source` | \n| dash, ash, sh, yash | `~/.profile` | `eval \"$(aiquota init sh --display=codex,claude)\"` | \n| ksh, mksh | `~/.kshrc` | `eval \"$(aiquota init ksh --display=codex,claude)\"` | \n\n| Command | What it does | \n|---|---|\n| `aiquota` | Full view with bars and reset times, refreshed if stale | \n| `aiquota line` | The color band from the cache, the same one printed when a terminal opens | \n| `aiquota line --plain` | The same information as plain text, for status bars | \n| `aiquota title` | Writes the summary to the title bar | \n| `aiquota refresh --force` | Queries everything now | \n| `aiquota --display=claude,codex` | Overrides the configured accounts for one command | \n\n```\n ● ChatGPT Plus [5h 12% ↻1h48m] [7d 61%] ┃ ● Claude Max 5x [5h 99%] [7d 92%] ┃ ● Freebuff Free [day 100%]\n```\n\n- **The dot** is a traffic light for the account's tightest window: green from 50% left, yellow from 20%, red below that. Grey means no data, for example after a login expires.\n- **`[5h 12%]`** is one window and the share left. An account can have several.\n- **`↻1h48m`** is the time until that window resets, shown when less than half is left.\n\nAn empty line separates the band from your first prompt. To remove it, add `--no-blank-line` to `aiquota install` or to your startup line.\n\nThe band always stays on one row. On narrower terminals it gives up detail in this order:\n\n| Terminal gets narrower | Example | \n|---|---|\n| Full | `ChatGPT Plus [5h 12% ↻1h48m] [7d 61%]` | \n| No plan name | `ChatGPT [5h 12% ↻1h48m] [7d 61%]` | \n| Short name | `GPT [5h 12% ↻1h48m] [7d 61%]` | \n| Tightest window only | `GPT [5h 12% ↻1h48m]` | \n| No reset time | `GPT [5h 12%]` | \n| Just the share left | `GPT 12%` | \n| Last accounts hidden | `GPT 12% ┃ +2` | \n\nIt uses 256 colors where available and falls back to 16 colors and plain ASCII.\n\nAdd `--short-names` to `aiquota install` or to your startup line to always use short names in the band and the title:\n\n| Account | `codex` | `claude` | `gemini` | `copilot` | `opencode` | `freebuff` | \n|---|---|---|---|---|---|---|\n| Name | ChatGPT | Claude | Gemini | Copilot | OpenCode | Freebuff | \n| Short name | GPT | Cld | Gem | Cop | OpC | Fbf | \n\n```\n ● GPT Plus [5h 12% ↻1h48m] [7d 61%] ┃ ● Cld Max 5x [5h 99%] [7d 92%] ┃ ● Fbf Free [day 100%]\n```\n\nThe full `aiquota` view keeps the complete names.\n\nTitle bars only show plain text, so this is a shorter summary with no colors or plan names:\n\n```\nChatGPT 12% 1h48m │ Claude 92% │ Freebuff 100%\n```\n\nFor each account you get the share left in the window that will stop you first. The time until it resets appears when less than half is left.\n\nA `~` before a value means it may be out of date: the login expired, the network failed, or the window\nhas reset since the last successful check.\n\nTo use it in a tmux status bar:\n\n```\nset -g status-right '#(aiquota line --plain --display=codex,claude)'\n```\n\n| `--display` name | Subscription | Windows | Verified against | \n|---|---|---|---|\n| `claude` | Claude Pro, Max, Team | 5h, 7d | Live API | \n| `codex` | ChatGPT plans, through Codex | 5h, 7d | Live API | \n| `freebuff` | Freebuff daily allowance | day | Live API | \n| `copilot` | GitHub Copilot | premium, chat | Live endpoint without a subscription, and test fixtures for the quota fields | \n| `opencode` | OpenCode Go | 5h, 7d, monthly | Third-party client's schema and test fixtures | \n| `gemini` | Gemini Code Assist Standard, Enterprise | pro, flash | Third-party docs and test fixtures | \n\nNote\n\nThese are mostly **undocumented endpoints**, the same ones the agents use for their own usage screens.\nThey can change without notice. When one does, AIQuota keeps showing the last known values, marked `~`.\n\nThis is a deliberate limit, not a missing feature. AIQuota answers one question: *which of the agents I\nalready pay for can I still use right now?* That means quota measured in time and resources until the next\nreset. API keys and metered, usage-based plans are never queried or shown, even if they are on your machine.\n\n**Logins expire while you're away.** AIQuota reads each agent's credentials but never refreshes them, because\nrefresh tokens can rotate and using one could log you out of the agent. So after a long break an account may\nshow `login expired`, or its last known values marked `~`, until you next open that agent. For example, the\nClaude access token lasts for hours and the ChatGPT one for days.\n\n**It replaces your title.** If your title bar normally shows the current directory, that's what you give up.\nSet `AIQUOTA_TITLE=0` before the startup line to keep your title and only get the band when a terminal opens.\n\n**IDE terminals show the band, not the title.** The band appears each time a terminal opens, in any terminal.\nJetBrains IDEs use their own fixed tab names, so the title summary doesn't appear there. In VS Code, set\n`\"terminal.integrated.tabs.title\": \"${sequence}\"` to see it in the tab. In either IDE, run `aiquota` for the full view.\n\n**Gemini is limited by Google.** Since June 2026, Gemini CLI login has only been served for Standard and\nEnterprise seats, so personal accounts show `no flat subscription found`.\n\nSet these as environment variables before the startup line, or in `~/.config/aiquota/config`:\n\n| Variable | Default | Meaning | \n|---|---|---|\n| `AIQUOTA_TTL` | `300` | Seconds between refreshes | \n| `AIQUOTA_TIMEOUT` | `8` | Seconds allowed per request | \n| `AIQUOTA_BANNER` | `1` | Set to `0` for no band when a terminal opens | \n| `AIQUOTA_TITLE` | `1` | Set to `0` to leave the title bar alone | \n| `AIQUOTA_ASCII` | unset | Set to `1` for plain ASCII output | \n| `NO_COLOR` | unset | Set to anything to turn colors off | \n\nAIQuota has no server and no telemetry. Each token goes only to the service that issued it.\n\n- Credentials are read-only, and are never copied to the cache or passed on a command line.\n- The cache in `~/.cache/aiquota` holds only plan names, percentages and times, and only you can read it.\n- Text from the network is stripped of control characters before it can reach your terminal.\n- Redirects are not followed, so a token can't be forwarded to another host.\n\nRuns anywhere with a POSIX shell, `awk` and `curl`.\n\n|  | Status | \n|---|---|\n| Script | Tested on dash, BusyBox ash, `bash --posix` and mksh | \n| Startup hooks | Tested in a real terminal session on bash, zsh, fish, dash and mksh | \n| OS | Tested on Linux. macOS runs in CI, and also reads Claude's login from the Keychain | \n| Windows | Should work in WSL or Git Bash, but isn't tested yet | \n\nNew accounts are welcome as long as they are flat subscriptions. See [CONTRIBUTING.md](https://github.com/francescobianco/aiquota/blob/main/CONTRIBUTING.md).", "url": "https://wpnews.pro/news/see-what-s-left-of-your-flat-rate-ai-subscriptions-every-time-you-open-a-termina", "canonical_source": "https://github.com/francescobianco/aiquota", "published_at": "2026-11-02 10:20:41+00:00", "updated_at": "2026-11-02 10:52:35.206492+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-products"], "entities": ["AIQuota", "Francesco Bianco", "ChatGPT", "Claude", "GitHub Copilot", "Gemini", "OpenCode", "Freebuff"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/see-what-s-left-of-your-flat-rate-ai-subscriptions-every-time-you-open-a-termina", "markdown": "https://wpnews.pro/news/see-what-s-left-of-your-flat-rate-ai-subscriptions-every-time-you-open-a-termina.md", "text": "https://wpnews.pro/news/see-what-s-left-of-your-flat-rate-ai-subscriptions-every-time-you-open-a-termina.txt", "jsonld": "https://wpnews.pro/news/see-what-s-left-of-your-flat-rate-ai-subscriptions-every-time-you-open-a-termina.jsonld"}}