Skip to content

Cost in storage/session is always 0 #2891

Closed

Description

@vasilvestre

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
        }

Activity

  1. github-actions commented on Oct 1, 2025

    @github-actions
    Contributor

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

    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.

  2. rekram1-node commented on Oct 1, 2025

    @rekram1-node
    Contributor

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

    What model are you using?

  3. vasilvestre commented on Oct 1, 2025

    @vasilvestre
    Author

    @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

  4. rekram1-node commented on Oct 1, 2025

    @rekram1-node
    Contributor

    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!

  5. vasilvestre commented on Oct 2, 2025

    @vasilvestre
    Author

    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

  6. rekram1-node commented on Oct 2, 2025

    @rekram1-node
    Contributor

    thanks! ill take a look

  7. rekram1-node commented on Oct 2, 2025

    @rekram1-node
    Contributor

    @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

  8. vasilvestre commented on Oct 2, 2025

    @vasilvestre
    Author

    @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

  9. rekram1-node commented on Oct 2, 2025

    @rekram1-node
    Contributor

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

  10. rekram1-node commented on Oct 2, 2025

    @rekram1-node
    Contributor

    mind if I reword your issue to reflect that?

  11. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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