Usage Limit Status both in CLI and SDKs

Open 💬 4 comments Opened Apr 30, 2026 by alwint3r
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like to see the usage/status information via the CLI. Something akin to /status in the TUI.

Proposed Behavior
codex status

prints the following information in the terminal

Account status

  5h limit: 100% left (resets 14:39)
  Weekly limit: 91% left (resets 15:28 on 5 May)

Visit https://chatgpt.com/codex/settings/usage for up-to-date rate limits and credits.
codex status --json

prints the JSON so that it can be used in the SDK as well

{"rateLimits":{"limitId":"codex","limitName":null,"primary":{"usedPercent":0,"windowDurationMins":300,"resetsAt":1777534802},"secondary":{"usedPercent":9,"windowDurationMins":10080,"resetsAt":1777969707},"credits":{"hasCredits":false,"unlimited":false,"balance":"0"},"planType":"plus","rateLimitReachedType":null},"rateLimitsByLimitId":{"codex":{"limitId":"codex","limitName":null,"primary":{"usedPercent":0,"windowDurationMins":300,"resetsAt":1777534802},"secondary":{"usedPercent":9,"windowDurationMins":10080,"resetsAt":1777969707},"credits":{"hasCredits":false,"unlimited":false,"balance":"0"},"planType":"plus","rateLimitReachedType":null}}}

Additional information

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #19022

Powered by Codex Action

drogers0 · 2 months ago

For the codex status half — I built aistat, which already emits a structurally similar payload from the same account/rateLimits/read endpoint. Human view:

$ aistat -h
Claude usage
- personal@example.com (active) [Max 5x]
  - 5-hour: 92.0% (resets in 4h 53m)
  - 7-day: 71.0% (resets in 2d 5h)
- work@example.com [Max 20x]
  - 5-hour: 4.0% (resets in 4h 12m)
  - 7-day: 12.0% (resets in 5d 9h)

Codex usage
- personal@example.com (active) [Pro]
  - 5-hour: 25.0% (resets in 5h 16m)
  - 7-day: 18.0% (resets in 4d 18h)

and the JSON payload:

$ aistat usage codex
{
  "checked_at": "2026-05-29T18:21:04+00:00",
  "providers": {
    "codex": {
      "accounts": [
        {"email": "you@example.com", "plan": "Pro", "active": true,
         "limits": {
           "five_hour": {"used_percent": 0,  "remaining_percent": 100, "resets_at": "2026-05-29T22:39:00+00:00", "reset_after_seconds": 15780},
           "seven_day": {"used_percent": 9,  "remaining_percent": 91,  "resets_at": "2026-06-04T15:28:00+00:00", "reset_after_seconds": 593010}
         }}
      ]
    }
  }
}

The shape is slightly normalized (both used_percent and remaining_percent, since the displayed-remaining mismatch flagged in #24080 is a real footgun). Works against Plus/Pro/Business/Enterprise, and useful for SDK-ish consumers today while native codex status is designed.

https://github.com/drogers0/aistat

alwint3r · 2 months ago
For the codex status half — I built aistat, which already emits a structurally similar payload from the same account/rateLimits/read endpoint. Human view: $ aistat -h Claude usage - personal@example.com (active) [Max 5x] - 5-hour: 92.0% (resets in 4h 53m) - 7-day: 71.0% (resets in 2d 5h) - work@example.com [Max 20x] - 5-hour: 4.0% (resets in 4h 12m) - 7-day: 12.0% (resets in 5d 9h) Codex usage - personal@example.com (active) [Pro] - 5-hour: 25.0% (resets in 5h 16m) - 7-day: 18.0% (resets in 4d 18h) and the JSON payload: $ aistat usage codex { "checked_at": "2026-05-29T18:21:04+00:00", "providers": { "codex": { "accounts": [ {"email": "you@example.com", "plan": "Pro", "active": true, "limits": { "five_hour": {"used_percent": 0, "remaining_percent": 100, "resets_at": "2026-05-29T22:39:00+00:00", "reset_after_seconds": 15780}, "seven_day": {"used_percent": 9, "remaining_percent": 91, "resets_at": "2026-06-04T15:28:00+00:00", "reset_after_seconds": 593010} }} ] } } } The shape is slightly normalized (both used_percent and remaining_percent, since the displayed-remaining mismatch flagged in #24080 is a real footgun). Works against Plus/Pro/Business/Enterprise, and useful for SDK-ish consumers today while native codex status is designed. https://github.com/drogers0/aistat

Nice!

But I don't want to use another tool to check Codex usage limits.

joyfrai · 12 days ago

I did a pretty simple and convenient solution to this problem. Hopefully it helps someone else too: https://t.me/webbuildozer/28