Codex CLI usage monitor — fetches rate limits from OpenAI's ChatGPT backend API
Project description
codex-cli-usage
Codex CLI usage monitor. Fetches your rate limit data from OpenAI's ChatGPT backend API and displays it in the terminal.
Example output
codex-cli-usage command:
Plan: plus
Session (5h) 39% resets 1h26m
Week (7d) 15% resets 143h26m
Codex statusline (self-caching — refreshes from API when stale, no daemon needed):
5h:39% 7d:15% plus reset:1h26m
Install
uv tool install codex-cli-usage
Then run:
# Check usage once
codex-cli-usage
# Run the daemon (keeps usage-limits.json updated)
codex-cli-usage daemon
Commands
| Command | Description |
|---|---|
codex-cli-usage |
Show current usage (colored terminal output) |
codex-cli-usage json |
Print raw JSON |
codex-cli-usage daemon [-i SECS] |
Run in foreground, refresh every 5 min (customizable) |
codex-cli-usage statusline |
Compact statusline (self-caching, no daemon needed) |
codex-cli-usage install |
Print setup instructions |
How Codex CLI rate limiting works
Discovered by inspecting the Codex CLI and its authentication flow.
Data sources
Codex CLI gets rate limit data from:
/backend-api/codex/usageendpoint — Returns utilization percentages and reset times for each rate limit window (primary 5h, secondary 7d, plus per-model and code review limits).
Rate limit types
| Type | Description |
|---|---|
primary_window |
Rolling 5-hour session window |
secondary_window |
Rolling 7-day all-models window |
additional_rate_limits |
Per-model limits (e.g. specific model caps) |
code_review_rate_limit |
Code review usage limit |
Authentication
The OAuth tokens live at ~/.codex/auth.json, written by the Codex CLI on login.
The access token expires roughly hourly. codex-cli-usage refreshes it automatically using the stored refresh token.
Local files
| File | Written by | Contains |
|---|---|---|
~/.codex/auth.json |
Codex CLI | OAuth tokens (access, refresh, id_token) |
~/.codex/usage-limits.json |
codex-cli-usage daemon | Cached API usage data (this tool) |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_cli_usage-0.1.6.tar.gz.
File metadata
- Download URL: codex_cli_usage-0.1.6.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8578a6cd104cba17c44ca96d1655889afd4fe069cfec285c01cf84953b173b7
|
|
| MD5 |
2e117fa5e23b8155a10b943c763b8aa1
|
|
| BLAKE2b-256 |
e1753a401cdd18be22d995b68e5eca782a4b3763c037d486df05284e1fcce420
|
Provenance
The following attestation bundles were made for codex_cli_usage-0.1.6.tar.gz:
Publisher:
publish.yml on wakamex/codex-cli-usage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_cli_usage-0.1.6.tar.gz -
Subject digest:
d8578a6cd104cba17c44ca96d1655889afd4fe069cfec285c01cf84953b173b7 - Sigstore transparency entry: 1114461081
- Sigstore integration time:
-
Permalink:
wakamex/codex-cli-usage@bc2186a23c2e34ec2912ac7f03dac9be14234205 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/wakamex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc2186a23c2e34ec2912ac7f03dac9be14234205 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codex_cli_usage-0.1.6-py3-none-any.whl.
File metadata
- Download URL: codex_cli_usage-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f935f019b939e45144759722a9efb39dcefc334ff079591436fb3c4672f580a4
|
|
| MD5 |
8faf889810061588853df012745fbf14
|
|
| BLAKE2b-256 |
15014d8852a31cda8239eb0ae0438e49766c84fbc6e55fb1b020a1250a34b9cd
|
Provenance
The following attestation bundles were made for codex_cli_usage-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on wakamex/codex-cli-usage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_cli_usage-0.1.6-py3-none-any.whl -
Subject digest:
f935f019b939e45144759722a9efb39dcefc334ff079591436fb3c4672f580a4 - Sigstore transparency entry: 1114461083
- Sigstore integration time:
-
Permalink:
wakamex/codex-cli-usage@bc2186a23c2e34ec2912ac7f03dac9be14234205 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/wakamex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc2186a23c2e34ec2912ac7f03dac9be14234205 -
Trigger Event:
release
-
Statement type: