Show remaining Codex credits / usage in the CLI statusline

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

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 #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.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 4 months ago

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

  • #17827
  • #18812

Powered by Codex Action

0xaust1n · 4 months ago

Preach Preach Preach

etraut-openai contributor · 4 months ago

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.

koby08 · 4 months ago

@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

drogers0 · 2 months ago

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

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

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