Around $30 just disappeared from my Zen account #2754

Closed
opened 2026-02-16 17:37:06 -05:00 by yindo · 6 comments
Owner

Originally created by @vojtechgistr on GitHub (Nov 10, 2025).

Originally assigned to: @fwang on GitHub.

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

Originally created by @vojtechgistr on GitHub (Nov 10, 2025). Originally assigned to: @fwang on GitHub. ### 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 <img width="1456" height="827" alt="Image" src="https://github.com/user-attachments/assets/2d1bc792-12bc-46de-b9d1-aa1cda49f925" /> <img width="1278" height="639" alt="Image" src="https://github.com/user-attachments/assets/f37bf89f-a735-40d9-90d4-9538b29bad53" /> ### Operating System macOS 26.0.1 ### Terminal WezTerm
yindo added the bugzen labels 2026-02-16 17:37:06 -05:00
yindo closed this issue 2026-02-16 17:37:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 10, 2025):

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

  • #3171: The usage information from opencode doesn't match the usage shown in Zen dashboard

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

@github-actions[bot] commented on GitHub (Nov 10, 2025): This issue might be a duplicate of existing issues. Please check: - #3171: The usage information from opencode doesn't match the usage shown in Zen dashboard Feel free to ignore if none of these address your specific case.
Author
Owner

@fwang commented on GitHub (Nov 10, 2025):

@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.

@fwang commented on GitHub (Nov 10, 2025): @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 <img width="1452" height="242" alt="Image" src="https://github.com/user-attachments/assets/0b0a2a28-c224-4857-884e-3178485ddefa" /> 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.
Author
Owner

@vojtechgistr commented on GitHub (Nov 10, 2025):

@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.

@vojtechgistr commented on GitHub (Nov 10, 2025): @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.
Author
Owner

@smolikzd commented on GitHub (Nov 10, 2025):

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

@smolikzd commented on GitHub (Nov 10, 2025): Hi @vojtechgistr , @fwang , I just reported the same issue with Zen and Sonet 4.5 model. Regards, Zdenek
Author
Owner

@fwang commented on GitHub (Nov 10, 2025):

@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.

@fwang commented on GitHub (Nov 10, 2025): @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.
Author
Owner

@vojtechgistr commented on GitHub (Nov 10, 2025):

Oh- I see. Okay, thank you.

@vojtechgistr commented on GitHub (Nov 10, 2025): Oh- I see. Okay, thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2754