Skip to content

Show remaining Codex credits / usage in the CLI statusline #19555

Open

Description

@bjornmv

Feature request

Please add a Codex CLI statusline field that shows remaining Codex plan usage / credit balance, similar to how Claude Code surfaces remaining usage directly in the terminal.

Today the CLI can show useful local/session state such as model, reasoning level, current directory, git branch, and context remaining. However, remaining Codex usage or credits are not available as a first-class statusline item. Users have to leave the terminal and open Codex Settings → Usage / Credits to understand whether they are close to a plan or purchased-credit limit.

Why this matters

For long agentic coding sessions, remaining usage is operationally important. It affects whether a user should:

  • continue with the current model or switch to a cheaper/smaller one
  • enable or avoid fast mode
  • compact/reset context before continuing
  • pause work before hitting a limit mid-task
  • buy credits or wait for included usage to reset

This is especially important because Codex usage varies heavily with task size, context size, model choice, fast mode, and long-running agent workflows.

Suggested statusline fields

Add one or more selectable /statusline fields, for example:

status_line = [
  "model-with-reasoning",
  "codex-credits-remaining",
  "codex-usage-remaining",
  "context-remaining",
  "current-dir",
]

Possible rendered examples:

gpt-5.4 high · Credits $12.40 · Context 72% left · ~/repo

or

gpt-5.4 high · Codex usage 63% left · Credits $12.40 · ~/repo

Notes

  • If exact usage cannot be fetched cheaply or reliably, a stale/last-known value with a timestamp would still be useful.
  • If there are separate windows/limits, showing the most constraining limit first would be helpful.
  • If an organization/workspace has no credit data available, the field could be omitted or show usage unavailable.
  • This is related to broader usage/limits visibility requests such as Feature: Expose full usage/limits data in CLI (/status command) #15281, but specifically asks for a statusline field so users can monitor budget without leaving the CLI.

Comparison

Claude Code surfaces remaining usage in the terminal. Codex should have comparable terminal-native budget visibility.

Activity

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

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. 0xaust1n commented on Apr 25, 2026

    @0xaust1n

    Preach Preach Preach

  4. removed
    CLI
    TUI
    on Apr 25, 2026
  5. etraut-openai commented on Apr 25, 2026

    @etraut-openai
    Contributor

    The client currently doesn't have access to the number of remaining Codex credits. That concept doesn't really even make sense for Business subscriptions because the credits are a shared pool for all users in the organization.

  6. koby08 commented on Apr 30, 2026

    @koby08

    @etraut-openai it's no longer the case - there are now per-user credits limits. It can be very useful for a user to know his current status against it's configured limit

  7. drogers0 commented on Jun 3, 2026

    @drogers0

    Until a native item lands, the per-user credit limits are reachable today via account/rateLimits/read — I built aistat to read them:

    $ 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)

    For a statusline you'd usually pull one field via jq:

    $ aistat usage codex | jq -r '.providers.codex.accounts[] | select(.active) | .limits.five_hour | "5h \(.remaining_percent)% left, resets in \(.reset_after_seconds/60|floor)m"'
    5h 75% left, resets in 315m

    Same binary feeds the Claude Code statusline you're comparing to.

    https://github.com/drogers0/aistat

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

    enhancementrate-limits

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions