Skip to content

Usage Limit Status both in CLI and SDKs #20310

Open

Description

@alwint3r

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

Activity

  1. added
    enhancement
    on Apr 30, 2026
  2. added
    CLI
    rate-limits
    on Apr 30, 2026
  3. github-actions commented on Apr 30, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. added
    sdk
    and removed
    CLI
    rate-limits
    on Apr 30, 2026
  5. drogers0 commented on Jun 3, 2026

    @drogers0

    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
    - [email protected] (active) [Max 5x]
      - 5-hour: 92.0% (resets in 4h 53m)
      - 7-day: 71.0% (resets in 2d 5h)
    - [email protected] [Max 20x]
      - 5-hour: 4.0% (resets in 4h 12m)
      - 7-day: 12.0% (resets in 5d 9h)
    
    Codex usage
    - [email protected] (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": "[email protected]", "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

  6. alwint3r commented on Jun 11, 2026

    @alwint3r
    Author

    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

    • [email protected] (active) [Max 5x]
      • 5-hour: 92.0% (resets in 4h 53m)
      • 7-day: 71.0% (resets in 2d 5h)
    • [email protected] [Max 20x]
      • 5-hour: 4.0% (resets in 4h 12m)
      • 7-day: 12.0% (resets in 5d 9h)

    Codex usage

    • [email protected] (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": "[email protected]", "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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions