-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Show local Codex session costs for organization API-key users #2174
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Problem
CodexBar can display account-level Codex quota data through managed accounts, OAuth, CLI, or optional OpenAI web access. Developers who use Codex with an organization-provided API key often cannot access organization billing or usage views because those require administrator permissions.
Codex itself writes local JSONL session records that include the final token ledger for each conversation. CodexBar can use those records to provide a local API-rate estimate without an Admin API key or a billing API request.
Expected behavior
$CODEX_HOME/sessionswhen set, otherwise~/.codex/sessions.Local data source
For a session file, the final ledger is the last
token_countrecord:The estimator separates cached from uncached input before applying the configured model rates. The displayed amount is an API-rate estimate, not an organization invoice. Negotiated pricing, credits, and taxes can differ.
Privacy
This uses session files already stored locally. It does not upload session content, call the OpenAI billing API, or require administrator access.
Proposed fix
Implemented by PR #2172.