Skip to content

Add reasoning token usage on json output #5276

Closed as not planned
Closed as not planned

Description

@savva312

What feature would you like to see?

Currenly when calling codex cli using exec --json you get the usage like below

{
    "type": "turn.completed",
    "usage": {
        "input_tokens": 26549,
        "cached_input_tokens": 22272,
        "output_tokens": 1590
    }
}

but its missing the reasoning token count.

While this information is available in the session file that is created,

{
    "timestamp": "2025-10-17T05:54:20.209Z",
    "type": "event_msg",
    "payload": {
        "type": "token_count",
        "info": {
            "total_token_usage": {
                "input_tokens": 26549,
                "cached_input_tokens": 22272,
                "output_tokens": 1590,
                "reasoning_output_tokens": 1152,
                "total_tokens": 28139
            },
            "last_token_usage": {
                "input_tokens": 6245,
                "cached_input_tokens": 5376,
                "output_tokens": 407,
                "reasoning_output_tokens": 320,
                "total_tokens": 6652
            },
            "model_context_window": 272000
        },
        "rate_limits": {
            "primary": null,
            "secondary": null
        }
    }
}

Additional information

No response

Activity

  1. added
    enhancement
    on Oct 17, 2025
  2. etraut-openai commented on Dec 2, 2025

    @etraut-openai
    Contributor

    Thanks for the suggestion. This hasn't received any upvotes or follow-on posts in going on two months, so I'm going to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions