Add new event to log per LLM request token usage

Open 💬 0 comments Opened Jul 14, 2026 by fanyang-mono

What variant of Codex are you using?

codex cli

What feature would you like to see?

I would like to propose adding a new event to --json output to log token usage per LLM request, so that accurate cost can be calculated, based on pricing model listed here -> https://developers.openai.com/api/docs/pricing?latest-pricing=standard

The new event that I am proposing should looks like this

{"type":"request.completed","response_id":"resp-abc123","usage":{"input_tokens":280000,"cached_input_tokens":100000,"output_tokens":1500,"reasoning_output_tokens":0}}

Currently, only per turn token usage are logged.

Additional information

_No response_

View original on GitHub ↗