Cost in storage/session is always 0 #1897

Open
opened 2026-02-16 17:33:08 -05:00 by yindo · 10 comments
Owner

Originally created by @vasilvestre on GitHub (Oct 1, 2025).

Originally assigned to: @rekram1-node on GitHub.

I use copilot as a provider, the log message (json) always show a cost of 0$. Is that right ?

Example :

{
            "id": "prt_x",
            "messageID": "msg_x",
            "sessionID": "ses_x",
            "type": "step-finish",
            "tokens": {
                "input": 26535,
                "output": 1322,
                "reasoning": 0,
                "cache": {
                    "write": 0,
                    "read": 0
                }
            },
            "cost": 0
        }
Originally created by @vasilvestre on GitHub (Oct 1, 2025). Originally assigned to: @rekram1-node on GitHub. I use copilot as a provider, the log message (json) always show a cost of 0$. Is that right ? Example : ```json { "id": "prt_x", "messageID": "msg_x", "sessionID": "ses_x", "type": "step-finish", "tokens": { "input": 26535, "output": 1322, "reasoning": 0, "cache": { "write": 0, "read": 0 } }, "cost": 0 } ```
Author
Owner

@github-actions[bot] commented on GitHub (Oct 1, 2025):

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

  • #2804: Similar cost tracking issue where users cannot view usage/cost when using Amazon Bedrock provider

Both issues involve cost/usage tracking not working properly across different providers, which suggests this might be a broader issue with cost calculation in OpenCode.

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

@github-actions[bot] commented on GitHub (Oct 1, 2025): This issue might be a duplicate of existing issues. Please check: - #2804: Similar cost tracking issue where users cannot view usage/cost when using Amazon Bedrock provider Both issues involve cost/usage tracking not working properly across different providers, which suggests this might be a broader issue with cost calculation in OpenCode. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

@vasilvestre can you share a session? I can't replicate

What model are you using?

@rekram1-node commented on GitHub (Oct 1, 2025): @vasilvestre can you share a session? I can't replicate What model are you using?
Author
Owner

@vasilvestre commented on GitHub (Oct 1, 2025):

@vasilvestre can you share a session? I can't replicate

What model are you using?

I can !

I'm using chat gpt 4.x (5 I think) and claude sonnet 4.5 with copilot

@vasilvestre commented on GitHub (Oct 1, 2025): > [@vasilvestre](https://github.com/vasilvestre) can you share a session? I can't replicate > > What model are you using? I can ! I'm using chat gpt 4.x (5 I think) and claude sonnet 4.5 with copilot
Author
Owner

@rekram1-node commented on GitHub (Oct 1, 2025):

if u send session I can prolly debug just because at a glance I dont see the issue so it'd be helpful to debug even if it is extra, thanks!

@rekram1-node commented on GitHub (Oct 1, 2025): if u send session I can prolly debug just because at a glance I dont see the issue so it'd be helpful to debug even if it is extra, thanks!
Author
Owner

@vasilvestre commented on GitHub (Oct 2, 2025):

if u send session I can prolly debug just because at a glance I dont see the issue so it'd be helpful to debug even if it is extra, thanks!

https://opencode.ai/s/D42d75IW

@vasilvestre commented on GitHub (Oct 2, 2025): > if u send session I can prolly debug just because at a glance I dont see the issue so it'd be helpful to debug even if it is extra, thanks! https://opencode.ai/s/D42d75IW
Author
Owner

@rekram1-node commented on GitHub (Oct 2, 2025):

thanks! ill take a look

@rekram1-node commented on GitHub (Oct 2, 2025): thanks! ill take a look
Author
Owner

@rekram1-node commented on GitHub (Oct 2, 2025):

@vasilvestre

I think technically though since it is a subscription there are no added fees so what would you expect to be seeing here?

This looks intentional for copilot since u pay a subscription for it not per token

@rekram1-node commented on GitHub (Oct 2, 2025): @vasilvestre I think technically though since it is a subscription there are no added fees so what would you expect to be seeing here? This looks intentional for copilot since u pay a subscription for it not per token
Author
Owner

@vasilvestre commented on GitHub (Oct 2, 2025):

@vasilvestre

I think technically though since it is a subscription there are no added fees so what would you expect to be seeing here?

This looks intentional for copilot since u pay a subscription for it not per token

I'm not sure, maybe the number of "premium" requests ? We can see the reasoning tokens

@vasilvestre commented on GitHub (Oct 2, 2025): > @vasilvestre > > I think technically though since it is a subscription there are no added fees so what would you expect to be seeing here? > > > This looks intentional for copilot since u pay a subscription for it not per token I'm not sure, maybe the number of "premium" requests ? We can see the reasoning tokens
Author
Owner

@rekram1-node commented on GitHub (Oct 2, 2025):

hm yeah that would require some reworking since the billing setup for copilot is so much different but that makes sense

@rekram1-node commented on GitHub (Oct 2, 2025): hm yeah that would require some reworking since the billing setup for copilot is so much different but that makes sense
Author
Owner

@rekram1-node commented on GitHub (Oct 2, 2025):

mind if I reword your issue to reflect that?

@rekram1-node commented on GitHub (Oct 2, 2025): mind if I reword your issue to reflect that?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1897