Skip to content

Live usage token count does not include cached tokens #179

Closed

Description

@TreeOfLearning

For example, here is the live usage tracker (freshly re-run, so it is up to date):

Image

And here is the report with a breakdown:

Image

You can see that the usage reported by the live tracker only contains the sum of the input and output tokens, not cache create and cache read. But this doesn't make sense; while the cost of cache read tokens is minimal, cache create actually costs more than input:

Image

So surely the live usage should at the very least show the cache create count in addition to input + output?

Activity

  1. ryoppippi commented on Jun 23, 2025

    @ryoppippi
    Member

    oh really, thanks.

    I think you can fix it! send us a PR

  2. ryoppippi commented on Jun 23, 2025

    @ryoppippi
    Member

    but it is difficult to estimate the max token if we consider cached token

    I think @a-c-m knows about it

  3. ashleyww93 commented on Jun 23, 2025

    @ashleyww93

    Difficult or not, it is taken into account on anthropic's side.

    I would rather usage be correct, and projection be off, rather than it be totally wrong.

  4. ryoppippi commented on Jun 23, 2025

    @ryoppippi
    Member

    Hmm, everybody has different opinion. so please give us a brief proposal here!

  5. TreeOfLearning commented on Jun 24, 2025

    @TreeOfLearning
    ContributorAuthor

    oh really, thanks.

    I think you can fix it! send us a PR

    Sorry, I don't have the bandwidth for contributing to this project at the moment, unfortunately.

    Hmm, everybody has different opinion. so please give us a brief proposal here!

    Not sure what you mean here. What opinion is differing? We know for sure that cached tokens count in some way towards usage, with the max plan at least.

  6. added a commit that references this issue on Jun 25, 2025
    3499b08
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions