OpenAI
Track OpenAI Codex usage limits locally
Codex limits usage with a 5-hour window and a weekly window, and models such as GPT-5.3-Codex-Spark have their own separate limits. Some accounts expose only the weekly window. Codex can also report a credit balance and the context window of its active session. Agent Tank shows how much of each limit you have used and when it resets, on a local dashboard and JSON API.
npm install -g agent-tank
agent-tank --codex
New to Agent Tank? Read Getting started
How Codex limits work
Codex limits usage with a 5-hour window and a weekly window, and models such as GPT-5.3-Codex-Spark have their own separate limits. Some accounts expose only the weekly window. Codex can also report a credit balance and the context window of its active session.
Agent Tank reports each limit as a window with a type (session, five_hour or weekly), the percentage used and remaining, and the reset time in ISO 8601, so Codex looks the same in the API as every other provider. For how the windows reset and what happens at a limit, read How five-hour and weekly usage windows work (Claude, Codex, Antigravity) and Claude vs Codex vs Antigravity: what each is good at and how their limits compare and How to avoid running out of limits mid-task and Codex usage limits and credits explained and Codex credits vs plan limits: when credits are used and Show coding agent usage in tmux, Waybar or SwiftBar and Track work and personal accounts together and How fast am I using my Claude Code limit? Pace and burn rate and Read coding agent usage from a script or VS Code task and Do Codex Fast and Ultrafast modes use more of my limits?.
For plan details, see OpenAI’s OpenAI Codex documentation.
What Agent Tank tracks
| Window | Type | Model | Notes |
|---|---|---|---|
| 5h limit | five_hour |
— | Not present on accounts that only expose a weekly window |
| Weekly limit | weekly |
— | — |
| GPT-5.3-Codex-Spark 5h limit | five_hour |
GPT-5.3-Codex-Spark | Per-model limits are separate windows |
| Plan | The Codex plan type, lowercased ("plus"). | ||
| Context window | Reported by Codex itself (/status or its app-server) with source "cli", including used_tokens and percentages. Codex reports it only while it has an active session, so it is often null from a fresh codex process. | ||
| Credits | The Codex credit balance, { "remaining": 48405, "unit": "credits" }, or null when Codex doesn't report one. History records it as the credits series. | ||
How it reads the data
Prefers the Codex JSON-RPC account/rateLimits/read call and falls back to /status. Everything happens on your machine, through the codex CLI you are already signed in to.
- Agent Tank prefers JSON-RPC account/rateLimits/read from the local Codex CLI.
- If that is unavailable, it falls back to running /status.
- Context window and credits are parsed from /status ("Context window: N% left (X used / Y)", "Credits: N credits") or read from the JSON-RPC app-server response when it reports them.
- In the default activity refresh mode, Agent Tank watches
~/.codex/sessions/and~/.codex/and refreshes after you use the CLI.
Agent Tank never:
- scrape provider websites
- read browser cookies
- depend on a logged-in browser session
- MITM or inspect your network traffic
- send your usage data to a remote service
In the dashboard
Sample API output
Every account has its own endpoint. This is the work account:
curl -s http://127.0.0.1:3456/status/work | jq
{
"id": "work",
"provider": "codex",
"plan": "pro",
"status": "ok",
"last_updated": "2026-10-17T12:00:00.000Z",
"error": null,
"windows": [
{
"type": "five_hour",
"label": "5h limit",
"model": null,
"used_percent": 11,
"remaining_percent": 89,
"resets_at": "2026-10-17T15:00:00.000Z",
"resets_in_seconds": 10800,
"pace": {
"ratio": 0.28,
"burning_fast": false
}
},
{
"type": "weekly",
"label": "Weekly limit",
"model": null,
"used_percent": 39,
"remaining_percent": 61,
"resets_at": "2026-10-20T07:00:00.000Z",
"resets_in_seconds": 241200,
"pace": {
"ratio": 0.65,
"burning_fast": false
}
},
{
"type": "five_hour",
"label": "GPT-5.3-Codex-Spark 5h limit",
"model": "GPT-5.3-Codex-Spark",
"used_percent": 6,
"remaining_percent": 94,
"resets_at": "2026-10-17T13:00:00.000Z",
"resets_in_seconds": 3600,
"pace": {
"ratio": 0.08,
"burning_fast": false
}
},
{
"type": "weekly",
"label": "GPT-5.3-Codex-Spark Weekly limit",
"model": "GPT-5.3-Codex-Spark",
"used_percent": 23,
"remaining_percent": 77,
"resets_at": "2026-10-20T07:00:00.000Z",
"resets_in_seconds": 241200,
"pace": {
"ratio": 0.38,
"burning_fast": false
}
}
],
"context_window": {
"total_tokens": 258000,
"used_tokens": 14240,
"used_percent": 5.52,
"remaining_percent": 94.48,
"model": "gpt-5.3-codex",
"source": "cli"
},
"credits": {
"remaining": 48405,
"unit": "credits"
},
"raw": {
"…": "original per-provider payload"
}
}
raw, the untouched Codex payload, is abbreviated here. The sample is synthetic, generated by Agent Tank 0.10.0’s own normalizer.
List each window’s usage and reset time:
curl -s http://127.0.0.1:3456/status/work | jq '.windows[] | {label, used_percent, resets_at}'
Install and run
Install Agent Tank (Node.js 18+) and start it with Codex only:
npm install -g agent-tank
agent-tank --codex
It needs the OpenAI Codex CLI installed, signed in and on your PATH as codex. Agent Tank 0.10.0 was verified with version 0.162.1. Check yours with:
codex --version
Multiple accounts
Add one --agent per account as codex:<alias>=<path>. Each path is passed to codex as CODEX_HOME, so every account keeps its own login, and the alias becomes its id in /status/<alias>:
agent-tank \
--agent codex:work=/srv/accounts/codex-work \
--agent codex:personal=/srv/accounts/codex-personal
See Accounts and providers for the config file equivalent, or Getting started for the full setup.
Notes
- Per-model limits such as GPT-5.3-Codex-Spark are separate windows with model set; the account-wide windows have model null.
- Codex reports its context window only while it has an active session, so context_window is often null from a fresh codex process.
- History records the credit balance as the credits series and context window usage as contextUsedPercent.
Related
- Claude Code usage limit tracker
- Antigravity CLI usage limit tracker
- API reference
- Configuring accounts
- Context window and credits
- How five-hour and weekly usage windows work (Claude, Codex, Antigravity)
- Claude vs Codex vs Antigravity: what each is good at and how their limits compare
- How to avoid running out of limits mid-task
- Codex usage limits and credits explained
- Codex credits vs plan limits: when credits are used
- Show coding agent usage in tmux, Waybar or SwiftBar
- Track work and personal accounts together
- How fast am I using my Claude Code limit? Pace and burn rate
- Read coding agent usage from a script or VS Code task
- Do Codex Fast and Ultrafast modes use more of my limits?