Skip to content

feat: add model costs, TUI improvements, and usage normalization#6

Merged
JaredHatfield merged 1 commit into
mainfrom
codex-tui-cost-request-improvements
May 21, 2026
Merged

feat: add model costs, TUI improvements, and usage normalization#6
JaredHatfield merged 1 commit into
mainfrom
codex-tui-cost-request-improvements

Conversation

@JaredHatfield
Copy link
Copy Markdown
Member

Summary

  • Model costs: Add optional cost config per model (input/output/cache per million tokens). Costs are shown per-request, per-model, and as a total in TUI, plain text, and JSONL modes.
  • Usage normalization: Cached tokens are now subtracted from input tokens before display and cost calculation, preventing double-counting.
  • TUI redesign: Resizable tables with flexible columns, ASCII logo, separator rows, inline styling, and a configurable recent_requests count (default 10, max 100, set to 0 to hide).
  • Metrics precision: Only /v1/chat/completions requests count as model requests. Each recent request gets a monotonic sequence number.
  • Proxy fix: Strip User-Agent header on forwarded requests unless explicitly set by the caller.

- Add optional cost tracking per model with input/output/cache pricing
- Subtract cached tokens from uncached input to avoid double-counting
- Add recent_requests config option to control TUI request list size
- Redesign TUI with resizable tables, logo, and better column layout
- Only count /v1/chat/completions as model requests in metrics
- Strip User-Agent header on forwarded requests unless set by caller
- Add sequence numbers to recent requests for stable ordering
- Show per-request, per-model, and total cost in TUI, plain, and JSONL modes
@JaredHatfield JaredHatfield merged commit 2bf7f9f into main May 21, 2026
4 checks passed
@JaredHatfield JaredHatfield deleted the codex-tui-cost-request-improvements branch May 21, 2026 23:06
@github-project-automation github-project-automation Bot moved this from Todo to Done in UnitVectorY Labs May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant