Skip to content

OpenRouter costs not correct #454

Closed

Description

@seaweeduk

I use openrouter, and the cost value shown is always way higher than the actual cost I'm being charged by OpenRouter. I'm not using BYOK for anthropic I'm just using openrouter direct to claude 4 here.

Here's the openrouter data, total comes to 0.064215

Image

Here's what opencode showed for the same session shown above

Image

Love the tool keep up the awesome work guys

Activity

  1. self-assigned this
    on Jun 27, 2025
  2. codey-insightdesigns commented on Sep 8, 2025

    @codey-insightdesigns

    I am seeing this issue as well. Costs in opencode show $21, but only about $13 in OpenRouter

  3. Irrelon commented on Nov 5, 2025

    @Irrelon

    I've just upgraded opencode to the latest version 1.0.23 and can confirm this is still an issue.

  4. awrobel-gd commented on Jan 26, 2026

    @awrobel-gd

    I experience the same using openrouter through claude code

  5. radaiko commented on Jan 31, 2026

    @radaiko

    My experience is quite the opposite; the actual costs within OpenCode are always significantly lower than the deducted totals. I’ve specifically tested this with MiniMax-M2.1 and Kimi-K2.5, and the discrepancy is even more problematic with these models, making it difficult to track actual spend.

  6. MartinEmrich commented on Mar 4, 2026

    @MartinEmrich

    Same with using AWS Bedrock directly. Even in the same session, the $ spent counter sometimes even goes down.

  7. Pxys-io commented on Apr 3, 2026

    @Pxys-io

    Me too,, i am using Mimo-v2-pro on openrouter and the pricing diffrence is huge, opencode says input is 270k open router says i used 3M, keep inmind number of requests match!

    Image Image
  8. awrobel-gd commented on Apr 3, 2026

    @awrobel-gd

    @Pxys-io I think when you sup up Cache Read and Input tokens and output tokens and cache write, you would get the 3.77M in open router. For me usually this matches. But price reported by Anthropic SDK in Python vs. open router is very much different

  9. Pxys-io commented on Apr 3, 2026

    @Pxys-io

    @Pxys-io I think when you sup up Cache Read and Input tokens and output tokens and cache write, you would get the 3.77M in open router. For me usually this matches. But price reported by Anthropic SDK in Python vs. open router is very much different

    Yes that was basically it, if cache price wasn't set in models.dev the app assumes is zero, created a PR with fix

  10. Jaaaky commented on Apr 3, 2026

    @Jaaaky

    I can confirm this too in #20937 Actual is almost double the reported spent credit in opencode :(

  11. added a commit that references this issue on May 12, 2026
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