openai / openai/codex

Support cost and budget metrics in TUI status_line

Open
#38,721 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI enhancement rate-limits TUI
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

Codex TUI currently supports token/context/rate-limit status line items such as context-used, used-tokens, total-input-tokens, total-output-tokens, five-hour-limit, and weekly-limit.

Please add native cost and budget status line items so users can monitor estimated spending directly in the bottom status bar.

Desired status line items:

  • estimated-cost-current-session
  • estimated-cost-today
  • estimated-cost-month
  • billing-budget-limit
  • billing-budget-used
  • billing-budget-remaining
  • billing-budget-percent
  • rate-limit-reset-time
  • five-hour-limit-percent
  • weekly-limit-percent

Example display:

GPT-5.5 | team-brain (main) | $34.7 | today:$34.7 mo:$5108.1 | ctx:23.0% | 5h:3.0% reset:4h43m | 7d:21.0%

Requirements:

  • Cost should be calculated using the active model provider's actual pricing when available.
  • If exact billing data is unavailable, Codex should clearly mark values as estimated.
  • Cached input, cache write, output, and long-context multipliers should be handled separately.
  • For custom providers, allow users to configure per-model rates in config.toml.
  • Status line should expose both compact and detailed forms.
  • Values should not leak API keys, organization IDs, or account-sensitive billing metadata.

Why:

Users already see token and context usage in the TUI, but cannot quickly understand cost impact. For long-context coding sessions, cost awareness is important for budget control and model selection.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TUI status_line implementation and the existing context, token, and rate-limit items described in the issue; then inspect config.toml handling for custom-provider rates. Done means compact and detailed cost, budget, reset-time, and percentage items use provider pricing when available, clearly mark estimates otherwise, handle pricing multipliers, and avoid exposing sensitive billing metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, payments
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.