Codex Usage
Local Python CLI for reset credits, rate-limit windows, local usage metadata, read-only online usage/profile data, and optional API organisation usage.
Install
git clone https://github.com/MacSteini/Codex-UsageInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →Codex Usage
Codex Usage is a local command-line tool for people who want a clear view of their Codex reset credits, model availability, rate-limit windows, local usage metadata, local setup health, one-file session metadata, read-only online usage/profile data and optional OpenAI API organisation usage.
The project is intentionally small: one Python file, no package install and no third-party Python dependencies. The core Codex reports do not need an OpenAI API key. The optional api-usage report uses OPENAI_ADMIN_KEY when you choose that report.
Use it to see how many reset credits are available, when they expire in your local timezone, whether visible rate-limit windows are close to their limit, what local Codex metadata says about sessions, models, days and token totals, whether the local setup is ready for each report, what one session JSONL file contains at a metadata level, and what the OpenAI Admin API reports for organisation API usage and costs. You can export the main reports as TXT, JSON or CSV files beside the script.
This is not an official OpenAI or Codex tool. It does not redeem credits, buy credits, change your Codex or ChatGPT account, change Codex settings, or upload local transcripts. The Codex online data comes from undocumented ChatGPT/Codex backend endpoints, so treat it as useful operational information rather than a contractual billing statement. The optional api-usage report uses documented OpenAI Admin API endpoints for API organisation usage and costs; it is not ChatGPT or Codex subscription billing.
Requirements
- Python 3.10 or newer.
- macOS, Linux or Windows.
- Local Codex state under your Codex home directory for
local-usage. - A Codex login at
auth.jsoninside your Codex home directory and network access forresets,online-usage,alland menu quick summaries. OPENAI_ADMIN_KEYwith suitable organisation permissions for the optionalapi-usagereport.
No third-party Python packages are required. By default, Codex Usage reads Codex data from Path.home() / ".codex". Set CODEX_HOME to use a different Codex home directory.
The source layout is deliberately small:
.gitattributes
codex_usage.py
test_codex_usage.py
img/
LICENCE
README.md
Install And Run
Download or clone this repository, then open a terminal in the folder that contains codex_usage.py.
Make the script executable and start it:
chmod +x codex_usage.py
./codex_usage.py
If you prefer not to mark the file executable, run it through Python:
python3 codex_usage.py
On Windows, open PowerShell in the folder that contains codex_usage.py, then run the script with the Python launcher:
py -3 .\codex_usage.py
py -3 .\codex_usage.py local-usage
You can check the script syntax before running it:
python3 -m py_compile ./codex_usage.py
PowerShell equivalent:
py -3 -m py_compile .\codex_usage.py
The syntax check only verifies that Python can parse the script. It does not contact Codex and does not read your account data.
If your Codex data is not in the default user-profile .codex directory, set CODEX_HOME before running the script:
CODEX_HOME="/path/to/codex-home" ./codex_usage.py local-usage
PowerShell equivalent:
$env:CODEX_HOME = "C:\Users\you\.codex"
py -3 .\codex_usage.py local-usage
Use The Reports
Similar plugs
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1
Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…