Skip to content

bug: token cost seems inaccurate #2020

Closed

Description

@nikhilmaddirala

I have some questions about this example conversation: https://opencode.ai/s/XPu4Slcg

  1. It says Cost$0.25 Input Tokens 54541 Output Tokens 431 Reasoning Tokens — but according to openrouter the cost of z-ai/glm-4.5 is $0.20/M input tokens $0.80/M output tokens, which is much lower. Is this discrepancy due to a bug in opencode?
  2. Where are the 50k+ input tokens coming from for my query and how can I inspect them?

Thanks in advance!

Activity

  1. github-actions commented on Aug 17, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Aug 17, 2025

    @rekram1-node
    Contributor

    Looking at openrouter I see:
    Input: $0.6/M
    Output: $2.20/M

    see here

  3. changed the title [-]Cost and token usage questions[/-] [+]bug: token cost seems inaccurate[/+] on Aug 17, 2025
  4. nikhilmaddirala commented on Aug 17, 2025

    @nikhilmaddirala
    Author

    Looking at openrouter I see:
    Input: $0.6/M
    Output: $2.20/M

    see here

    But even w/ those numbers the cost seems incorrect...

    When I click your link I see the same numbers I cited in my OP.

  5. rekram1-node commented on Aug 17, 2025

    @rekram1-node
    Contributor

    @nikhilmaddirala I was looking at:

    Image

    But yes you are correct and this appears to be a bug, thank you for reporting

  6. nikhilmaddirala commented on Aug 17, 2025

    @nikhilmaddirala
    Author

    image

  7. spoons-and-mirrors commented on Aug 19, 2025

    @spoons-and-mirrors
    Contributor

    somewhat related to #1937 I believe

  8. rekram1-node commented on Aug 22, 2025

    @rekram1-node
    Contributor

    just to provide insight into where the tokens are coming from, looks like vast majority are from the web fetch results, they can be rather expensive depending on website & content

  9. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions