Skip to content

Around $30 just disappeared from my Zen account #4160

Closed

Description

@vojtechgistr

Description

Hi, I was using OpenCode, model Claude Sonnet 4.5. The session currently has 287,280 tokens, 29% context used, $35.39 spent.

When I spent around $21 I added another $45 to my account. After a quick break I started using opencode again, when I reached the $35.39 I got a message about insufficient balance. I look online and my balance is $-0.12. How did this happen? Is there any way to display complete log of usage? Even with that, it's really weird.

OpenCode version

1.0.10

Steps to reproduce

No response

Screenshot and/or share link

Image Image

Operating System

macOS 26.0.1

Terminal

WezTerm

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 10, 2025
  2. github-actions commented on Nov 10, 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.

  3. added
    zenRelates to Zen
    and removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 10, 2025
  4. fwang commented on Nov 10, 2025

    @fwang
    Contributor

    @vojtechgistr There is a bug in OpenCode's cost calculation for Sonnet 4.5.

    Sonnet 4.5 pricing depends on the prompt size - https://opencode.ai/docs/zen/#pricing

    Image

    When the context exceeds 200K, the cost doubles. Opencode CLI always uses the (< 200K tokens) price for the cost calculation. And Zen uses the correct calculation.

    Let me know if that makes sense. We are fixing this right now.

  5. vojtechgistr commented on Nov 10, 2025

    @vojtechgistr
    Author

    @fwang thank you for responding. In that case, can I get my balance back? $30 is quite a lot for me, and if this bug is there for some time, it took even more. I started using OpenCode a few weeks ago, mostly Sonnet 4.5. I thought that something was weird, the balance was disappearing pretty quickly.

  6. smolikzd commented on Nov 10, 2025

    @smolikzd

    Hi @vojtechgistr , @fwang ,
    I just reported the same issue with Zen and Sonet 4.5 model.
    Regards,
    Zdenek

  7. fwang commented on Nov 10, 2025

    @fwang
    Contributor

    @vojtechgistr The cost shown in Opencode CLI is wrong. It is less than the actual cost. We are fixing it.

    The cost charged in Zen is correct.

  8. vojtechgistr commented on Nov 10, 2025

    @vojtechgistr
    Author

    Oh- I see. Okay, thank you.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingzenRelates to Zen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions