Codex, through Codex
Ask the installed official app-server for its current quota windows and available reset balance. Codex manages its own existing sign-in; Agent Quota never opens your token files or starts inference.
A LITTLE MORE CLARITY
Read your coding subscription’s quota through one typed library and a small command-line tool. Keep a fresh reading, an unknown window and a stale cache distinct.
Node 20+ · Anthropic and installed Codex · local to your machine
$ agent-quota codex
Provider-reported quota windows
Usage · reset time · fetch time
Available resets · never redeemedIllustrative output · run the command to read your account.
NUMBERS WITH THEIR MEANING
Ask the installed official app-server for its current quota windows and available reset balance. Codex manages its own existing sign-in; Agent Quota never opens your token files or starts inference.
Supply your authorized OAuth token. Session, weekly, model-scoped and extra-usage readings preserve missing values and decimal currency amounts. Share a client to coordinate polling and simultaneous refreshes.
Provider-reported values remain labeled. Local fetch time tells you when a refresh happened; cached Anthropic data carries its freshness and error state. An absent window does not become zero.
Use a short command for a fresh Codex reading, or integrate the typed API into your own tool. No model turn, subscription change or reset redemption is part of the read.
START ON YOUR MACHINE
Download the npm-compatible package, verify its SHA256 and install it locally. It includes the CLI and typed library, with no runtime npm dependencies.
Download v0.2.1 packageSHA256 checksum4711532f69d2c781e5240a619990c23b05c1a40435efb4e7e363904c1a414de2npm install https://agent-quota.aylith.com/downloads/aylith-agent-quota-0.2.1.tgz
npx agent-quota --help
npx agent-quota codexInstall and sign in to the official Codex CLI first. Agent Quota uses that existing account; it does not choose another account from a label.
import { readCodexQuota } from '@aylith/agent-quota';
const result = await readCodexQuota();For Anthropic, supply your authorized token in ANTHROPIC_OAUTH_TOKEN and run agent-quota anthropic --account LABEL. The library also exposes AnthropicQuotaClient, QuotaBudget and SingleFlight.
GOOD TO KNOW
Sign in to the official Codex CLI before your first read. For Anthropic, provide your authorized OAuth token on your own machine. Your credentials stay in the tools you choose.
Run the CLI when you need a reading. In a long-running app, share an Anthropic client and persist its budget with your own store. Independent CLI processes have separate budgets; respect provider lockouts and leave time between refreshes.
Codex quota reads use the installed app-server’s rate-limit method. Anthropic subscription reads use its OAuth usage endpoint, which is undocumented and can change. Use a compatible Codex version and an authorized Anthropic token.
Install the package linked above with Node 20 or newer. Import the typed API to show usage, reset times and freshness in your own interface, and keep unknown values distinct from zero.