Show remaining Codex credits / usage in the CLI statusline
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.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Preach Preach Preach
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.
@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
Until a native item lands, the per-user credit limits are reachable today via
account/rateLimits/read— I builtaistatto read them:For a statusline you'd usually pull one field via jq:
Same binary feeds the Claude Code statusline you're comparing to.
https://github.com/drogers0/aistat
I did a pretty simple and convenient solution to this problem. Hopefully it helps someone else too: https://t.me/webbuildozer/28