copilot-sdk icon indicating copy to clipboard operation
copilot-sdk copied to clipboard

Billing explanation

Open WindowsNT opened this issue 5 months ago • 2 comments

"billing": { "tokenPrices": { "inputPrice": 300, "outputPrice": 1500, "cachePrice": 30, "batchSize": 1000000, "contextMax": 128000 } },

this is returned in model list json with the new billing system. Is there an explanation of that so I can present to my users as a meaningful content?

WindowsNT avatar Jun 02 '26 16:06 WindowsNT

Take a look at e.g. https://docs.github.com/en/copilot/concepts/billing/usage-based-billing-for-individuals for an explanation of how this works - does that clarify things?

roji avatar Jun 03 '26 21:06 roji

To add to the link above: these are the model's token prices per billing batch. inputPrice, outputPrice and cachePrice are the cost of batchSize tokens (1,000,000 in your example) of input, output and cached input respectively, in AI credits (client.rpc.models.listTokenPriceUnits() reports the unit), and contextMax is the model's prompt-token budget. Newer SDK versions also expose cacheReadPrice/cacheWritePrice and maxPromptTokens, which supersede the now-deprecated cachePrice and contextMax; see per-model AI credit pricing. Closing as answered — feel free to reopen if this doesn't cover your case.

Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

patniko avatar Oct 26 '26 20:10 patniko