codex icon indicating copy to clipboard operation
codex copied to clipboard

ASI - expose per-run usage and cost receipts in hosted Codex

Open Egly443 opened this issue 1 month ago • 9 comments

What variant of Codex are you using?

App Linux

What feature would you like to see?

Feature request: expose per-run usage and cost receipts in hosted Codex

I run an autonomous mathematical research and Lean verification programme using Codex and Claude. I need to measure operating cost and evaluate improvements, but hosted Codex does not currently expose provider-reported token usage or cost to the agent.

Please provide a machine-readable usage receipt through the runtime, plus a final receipt available after completion. Include:

  • Stable run ID and actual model/version.
  • Input, output and cached token counts.
  • Usage attributable to delegated agents, with clear rules preventing double counting.
  • Reported cost where available, clearly distinguishing estimated token-price cost from actual billed charges.
  • Explicit unavailable values rather than zero.
  • Receipts for failed, interrupted and cancelled runs.

An agent-readable tool for cumulative usage, paired with an exportable final receipt, would let existing workflows log this automatically.

Acceptance criterion: every completed or interrupted run can be linked to an authoritative usage receipt, with documented measurement boundaries and no invented cost values.

This is foundational observability. Without it, I cannot reliably compare configurations, quantify savings from shorter instructions, or assess whether autonomous improvements cost more than they save.

No metrics - no ASI !!!! 🙏 Working out what ASI improvements are cost effective first requires the metrics to exist otherwise your ASI metric is short of data.

Additional information

No response

Egly443 avatar Oct 11 '26 13:10 Egly443

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

  • #53022

Powered by Codex Action

github-actions[bot] avatar Oct 11 '26 13:10 github-actions[bot]

Would a receipt per task be enough for your research runs, or do you need it per agent inside one run?

kasrakhosravi avatar Oct 17 '26 09:10 kasrakhosravi

Right now I have a cloud task that kicks off with a standard prompt on a scheduled basis. All i think I need is the ability under that cloud session to have viz of amount of tokens used so far etc but visible inside the session, so the active cloud run can store its own metrics whilst running to gh for its run, maybe even the trace or other diags too when needed. Then the outer loop when it tries to optimise the runs can see the recorded telemetry for each run. I think to start with a very simple token count is enough, don’t want to burn more tokens on telemetry than on the actual work.

Egly443 avatar Oct 19 '26 10:10 Egly443

A plain count makes sense, cheap to keep. What do you think of a feature where each run writes its own token receipt next to its PR, and the outer loop reads them all in one place: would that help?

kasrakhosravi avatar Oct 20 '26 09:10 kasrakhosravi

When you say 'next to it's PR' you'd have to be clear if you mean in the pr, or a new field in GitHub or what ?

I'm aiming for a file that will list each run date & time, duration, which agent (multi vendor) ran, work registry pointer, tokens used, execution duration etc, trace file reference if applicable.

Then the outer loop can take this data, plus the code and the prompts and go to work, even mutating code, replaying and restesting CI and comparing execution duration and token use and delivery output... and converge ...

My main focus is not tokenmaxing for now, I like very lite weight telemetry or the cost will outweigh the gain.

Egly443 avatar Oct 20 '26 14:10 Egly443

That's close to what Steery does: it records each agent session's time and tokens across harnesses, so you can read them per run. If you want to try it with your outer loop: https://steery.dev

kasrakhosravi avatar Oct 21 '26 10:10 kasrakhosravi

@Egly443 Did you get to try it with your outer loop, or did something get in the way?

kasrakhosravi avatar Oct 27 '26 20:10 kasrakhosravi

My feature requested was "in hosted Codex" - I’m not a fan of extending my trust circle any more than it already has .... your proposal sounds great but requires me to trust a third party accepting no liability that I know nothing about.... All the best !

Egly443 avatar Oct 27 '26 22:10 Egly443

Strongly support per-run receipts. Please extend the accounting surface to a filterable, exportable account-level ledger that reconciles the visible allowance/credit balance with individual execution records where the provider retains that data. Each row should identify the timestamp, stable execution/parent ID, source (CLI, Desktop, Cloud, manual or automatic review, scheduled execution), trigger, actual model/effort, cached and uncached token counters, outcome and authoritative allowance impact or explicitly unavailable value. Include interrupted, failed, retried and background work; clarify attribution and prevent double-counting delegated runs. Aggregate lifetime token or plugin counts are not substitutes for an execution ledger. Acceptance: a user can choose a period, identify the executions associated with a balance change, export JSON/CSV and reconcile the totals within documented accounting boundaries. This is a product transparency request, not a claim that any account was charged incorrectly.

Ai3Ui avatar Dec 01 '26 14:12 Ai3Ui