Skip to content

Add "service_tier" to JSONL token usage logs #20311

Open

Description

@robinebers

What variant of Codex are you using?

CLI/App

What feature would you like to see?

The current JSONL files persist token usage via event_msg / token_count, including input, cached input, output, reasoning output, and total tokens.

Notably missing however is something like service_tier to understand if it was a normal or fast request.

This could be used to accurately estimate token usage and cost.

Minimal useful shape:

{
  "type": "token_count",
  "info": {
    "last_token_usage": { "...": "..." },
    "total_token_usage": { "...": "..." },
    "service_tier": "priority"
  }
}

Even adding service_tier to TurnContextItem or TokenCountEvent would be enough.

The service tier appears to already be logged temporarily in other logs, but they are not stable enough to use.

Additional information

Community tools like ccusage and OpenUsage calculate cost to provide an idea of how incredibly valuable the Codex subscription actually is.

It is however completely inaccurate, due to not knowing if a request was priority or not.

Activity

  1. added
    CLIIssues related to the Codex CLI
    appIssues related to the Codex desktop app
    rate-limitsIssues related to rate limits, quotas, and token usage reporting
    on Apr 30, 2026
  2. added
    agentIssues related to the core agent loop
    and removed
    rate-limitsIssues related to rate limits, quotas, and token usage reporting
    CLIIssues related to the Codex CLI
    appIssues related to the Codex desktop app
    on Apr 30, 2026
  3. robinebers commented on May 12, 2026

    @robinebers
    Author

    Gentle bump. Would love to see this added. Seems like a minor thing that would drastically improve client analytics.

  4. mjacobs commented on Aug 1, 2026

    @mjacobs

    For downstream cost tools, it would be helpful to record the actual response.completed service tier alongside that response’s raw token usage, separately from the requested or configured tier. If the actual tier is missing, consumers would be able to treat it as unknown (rather than infer it from /fast).

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

    agentIssues related to the core agent loopenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions