Skip to content

Github Copilot: Tracking Premium Requests #768

Closed as not planned
Closed as not planned

Description

@FareedFarag

When using Github copilot models, the cost tracker is irrelevant as it always stays at $0.00. Instead, is it possible to display the premium requests quota? See below image as an example from VS code copilot extension.

Image

Activity

  1. martinhpedersen commented on Jul 8, 2025

    @martinhpedersen

    FYI - Don't recall where I found it, but the data is available through this endpoint:

    curl https://api.github.com/copilot_internal/user -H "Authorization: Bearer $COPILOT_API_KEY" -H "Content-Type: application/json"

    If anyone is interested in a quick alias to get the current quota/usage:

    alias copilot-quota="curl -s https://api.github.com/copilot_internal/user -H 'Authorization: Bearer $COPILOT_API_KEY' -H 'Content-Type: application/json' | jq .quota_snapshots.premium_interactions"
  2. self-assigned this
    on Jul 9, 2025
  3. FareedFarag commented on Jul 10, 2025

    @FareedFarag
    Author

    FYI - Don't recall where I found it, but the data is available through this endpoint:

    curl https://api.github.com/copilot_internal/user -H "Authorization: Bearer $COPILOT_API_KEY" -H "Content-Type: application/json"

    If anyone is interested in a quick alias to get the current quota/usage:

    alias copilot-quota="curl -s https://api.github.com/copilot_internal/user -H 'Authorization: Bearer $COPILOT_API_KEY' -H 'Content-Type: application/json' | jq .quota_snapshots.premium_interactions"

    How do you get COPILOT_API_KEY? Copilot doesn't issue API keys as far as I know.

  4. asadmoosvi commented on Jul 26, 2025

    @asadmoosvi

    As a github copilot user, I think this would be a great addition to the software. Not having to open up the browser to look at remaining premium requests would be such a good quality-of-life improvement.

  5. berenar commented on Oct 27, 2025

    @berenar
    Contributor

    Here's a curl that uses your GitHub Copilot Oauth token instead:

    curl -s -H "Authorization: Bearer $(cat ~/.config/github-copilot/apps.json \
    | jq '.[].oauth_token' \
    | sed 's/^"\(.*\)"$/\1/')" https://api.github.com/copilot_internal/user
    

    As a user of Copilot, having this info in the UI would be very useful. I'm happy to implement this if the authors also see its value.
    cc @thdxr

  6. rekram1-node commented on Oct 27, 2025

    @rekram1-node
    Collaborator

    @berenar how would you go about implementing it? There will probably be other providers that have special billing things like copilot too

    This would be welcome but we would probably need to discuss how it would be shown in the ui

  7. berenar commented on Oct 28, 2025

    @berenar
    Contributor

    Providers support

    Well, so far I've only used Claude (subscription based), GitHub Copilot and Zen.

    • Anthropic has hourly and daily usage limits. → And an API to get that info
    • Copilot "has X premium requests per month" → And an (internal) API endpoint to get that info too

    I think the rest of supported providers are not subscription based (yet...), therefore they would not need this feature

    UI

    On how to show it in the UI, that's yours to decide :)

    I would leave the top right corner for info related to the current session

    • Context size
    • Context %
    • Cost so far
    Image

    And instead use the bottom right corner to show the provider limits
    Image

    The info to display would change based on the provider being used

    Claude

    • "Approaching hourly limit" Same as how Claude Code shows it
    • "Approaching daily limit"
    • "Limit resets at 3pm"

    Copilot

    • "80% used Premium Requests. Resets Nov. 1st"

    wdyt @rekram1-node ?

  8. rekram1-node commented on Oct 29, 2025

    @rekram1-node
    Collaborator

    Sorry for delay @berenar I think we should wait for opentui to be wrapped up before a PR is attempted here. Another thing we need to surface that currently isn't being surfaced is retries.

    I recently added some logic that will allow us to display the # of retries, if it is retrying, etc.

    And that would also tie into this because some plan quotas are rate limited and we do exponential backoffs with awareness of the rate limit headers so there are a few moving pieces here.

    That said I do like your proposal I just thing it will be best to revisit in a week once opentui has a little less stuff in motion

  9. itse4elhaam commented on Nov 25, 2025

    @itse4elhaam

    Hey, would love this!!!

    Any plans on this?

  10. rekram1-node commented on Nov 26, 2025

    @rekram1-node
    Collaborator

    No immediate plans but we should think about how we wanna show it

  11. flupkede commented on Dec 4, 2025

    @flupkede

    This same issue applies to z.ai Coding Plans. Cost tracking shows $0.00, but users have no visibility into their prompt quota. Even worse, z.ai does not even have an api call to track this.

    Not ideal however a possible approach:

    • Optional quotas config per provider, make it configurable per model: for example glm4.6: Lite: 120 prompts/5h , Pro: 600 prompts/5h, Max: 2400 prompts/5h
    • Track rolling window prompt count per configurable time window.
    • Display alongside cost/even hide cost for flat fee plan: "Cost: $0.00 | Usage: 87%" example based upon 104 requests of 120 limit)
  12. ojsef39 commented on Dec 11, 2025

    @ojsef39

    Would love to see this for Github and Anthropic, i use both and id love to see how much time i have left before i have to think for myself again :D

  13. rosematcha commented on Dec 17, 2025

    @rosematcha

    Agreed, would love to see this implemented for Copilot, Anthropic, and Codex subscription plans!

  14. peixotorms commented on Dec 30, 2025

    @peixotorms

    Copilot seems straightforward with just an api call, please add it to opencode.

  15. amaduswaray commented on Jan 7, 2026

    @amaduswaray

    We just started using OpenCode at work, and this would be useful! Are there any requirements beyond the contribution guide to submit a PR on this?

  16. 8 remaining items

  17. slhad commented on Feb 6, 2026

    @slhad

    I have seen Claude Opus 4.5 (preview) gone from 1x to 3x when "preview" title was removed, and it made me cry when I found out I was not hallucinating in VS Code,

    Theses changes can be devastating to the premium requests count (been here), I would be nice if it does not rely on manual update of hardcoded constants

  18. sTiKyt commented on Feb 11, 2026

    @sTiKyt

    Premium requests info can be added like this: Joost1982@f217b38 Only shows info when having a GitHub Copilot model selected:

    Image (uses the github token known by opencode, not the vsc / github cli token like in the comment above)

    but would be nice to see numeric values, not percentages imo

  19. sTiKyt commented on Feb 11, 2026

    @sTiKyt

    There should also be a way to show the model multiplier in the models selection UI & in the upcoming usage UI / sidebar

    I dug into the multiplier adding to opencode, and it’s not straightforward. The Copilot /models API only returns billing.multiplier if you call it like an IDE (Editor-Version, Editor-Plugin-Version, Copilot-Integration-Id, VScode-SessionId/MachineId, plus a Copilot token). With the normal GitHub OAuth token opencode uses, the endpoint 404s or says “token not authorized,” so there’s no clean/official way to fetch multipliers with the current implementation.
    What I ended up doing is a bit hacky: I reuse a local VS Code Copilot app token to mint a Copilot token, send the IDE headers, and then read billing.multiplier from /models. See: Joost1982@4c2cf2a
    It works on my machine (Debian), but it’s no real solution.
    Image

    What about just hardcoding the multipliers? They rarely change

    they often change, sometimes they even get more expensive under high load/demand, and show stuff like this:

    Image
  20. krzyk commented on Feb 11, 2026

    @krzyk

    they often change, sometimes they even get more expensive under high load/demand, and show stuff like this

    How often? I did see just one change in 6 months - promotional 1x for Opus 4.5 for (1 or 2 weeks) and it was advertised that it will change. And similar for Grok Code, but somehow I still have it at 0x, while on copilot page it is listed as 0.25x.

    I have not seen changes to multiplier based on load, your screenshot also doesn't show that. Models might be slow to respond, or not respond at all, but this is not change of multipliers.

  21. garthendrich commented on Feb 28, 2026

    @garthendrich

    any updates?

  22. tapajos commented on Mar 20, 2026

    @tapajos

    Any plan to add it?

  23. sTiKyt commented on Mar 21, 2026

    @sTiKyt

    they often change, sometimes they even get more expensive under high load/demand, and show stuff like this

    How often? I did see just one change in 6 months - promotional 1x for Opus 4.5 for (1 or 2 weeks) and it was advertised that it will change. And similar for Grok Code, but somehow I still have it at 0x, while on copilot page it is listed as 0.25x.

    I have not seen changes to multiplier based on load, your screenshot also doesn't show that. Models might be slow to respond, or not respond at all, but this is not change of multipliers.

    Well, just as example, not much time passed and we see this as of now:

    Image

    But yes, i did see multiplier based on load once or twice in the entire time, so it does happen but is rare

  24. lukasbash commented on Mar 28, 2026

    @lukasbash

    Any update? Especially just polishing #768 (comment) would bring so much benefit for a fair effort for the community!

  25. csj0oe commented on Apr 28, 2026

    @csj0oe

    Copilot will soon (June 1, 2026) switch to usage-based billing, see:
    https://docs.github.com/en/copilot/concepts/billing/usage-based-billing-for-individuals

  26. llucax commented on Apr 29, 2026

    @llucax

    I discovered this amazing plugin: https://github.com/slkiser/opencode-quota.

  27. javad-ent commented on May 11, 2026

    @javad-ent

    Copilot will soon (June 1, 2026) switch to usage-based billing, see: https://docs.github.com/en/copilot/concepts/billing/usage-based-billing-for-individuals

    This is a scandal! They're making the models significantly more expensive! That's not a 10% increase, not 50%, not even 100%. They're making all models 6 to 9 times more expensive! That's a 600% to 900% increase! And at the same time, they're cutting the quota of pro accounts in half! That's another 100% nasty and hidden cost increase! So in total, they're increasing the cost 10 fold, that's a whopping 1000% price hike!

    Check it for yourself:
    https://docs.github.com/en/copilot/reference/copilot-billing/model-multipliers-for-annual-plans
    https://docs.github.com/en/copilot/concepts/billing/usage-based-billing-for-individuals

    Plan Total AI credits per month
    Copilot Pro 1000

    1 AI credits = $0.01 USD, so a $10 budget covers 1,000 AI credits.

    The pro plans cost 20$, but now they contain $10 worth of "AI credits"! This is a scam! And GitHub should be sued with a class lawsuit!

    Looks like they're reserving their resources for other purposes (e.g., the illegal aggression and attack against Iran) and sacrificing all paying customers, even outside the US, for that.

  28. FareedFarag commented on May 14, 2026

    @FareedFarag
    Author

    Given GitHub's recent switch from premium requests to AI credits as their billing unit, this makes the scope of this issue irrelevant. Closing.

  29. javad-ent commented on May 17, 2026

    @javad-ent

    Given GitHub's recent switch from premium requests to AI credits as their billing unit, this makes the scope of this issue irrelevant. Closing.

    Are you planning to show the credit usage then?

  30. FareedFarag commented on May 18, 2026

    @FareedFarag
    Author

    Given GitHub's recent switch from premium requests to AI credits as their billing unit, this makes the scope of this issue irrelevant. Closing.

    Are you planning to show the credit usage then?

    I'm not a maintainer for OpenCode. I don't get to decide.

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