You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Around $30 just disappeared from my Zen account #4160
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.
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 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.
Activity
github-actions commentedon Nov 10, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
fwang commentedon 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
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.
vojtechgistr commentedon 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.
smolikzd commentedon Nov 10, 2025
Hi @vojtechgistr , @fwang ,
I just reported the same issue with Zen and Sonet 4.5 model.
Regards,
Zdenek
fwang commentedon 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.
vojtechgistr commentedon Nov 10, 2025
Oh- I see. Okay, thank you.