GitHub Copilot bills in credits, but credits can hide the part engineers actually need to understand: which model consumed what. A new AI usage REST API update from GitHub now returns raw per-model token counts, including cache reads, cache writes, and image tokens. That makes it possible to build a real usage dashboard instead of trying to reverse-engineer a monthly bill.
Here is the immediate answer. Query the AI credit usage endpoint at the level that pays for the Copilot license: enterprise, organization, or individual account. Each item can now contain six token fields. They are usage telemetry, not a cost calculation, and the documented data set generally begins on 1 December 2026.
What GitHub added to the AI usage API
GitHub added token counts to three existing endpoints:
GET /enterprises/{enterprise}/settings/billing/ai_credit/usageGET /organizations/{org}/settings/billing/ai_credit/usageGET /users/{username}/settings/billing/ai_credit/usage
The endpoint you need depends on who is billed. GitHub’s billing API documentation is clear on the important boundary: personal endpoints cover a user who bought their own Copilot plan. If an organization or enterprise manages that license, usage belongs in the organization or enterprise response instead.
| Field | What it records | Why it is useful |
|---|---|---|
tokenInput | Tokens sent to the model | Shows prompt and context volume |
tokenOutput | Tokens generated by the model | Highlights long answers and agent output |
tokenImageInput | Image tokens sent to the model | Separates visual workflows from text-only work |
tokenImageOutput | Image tokens generated by the model | Surfaces image-producing use cases |
tokenCacheRead | Cached tokens read by the model | Shows repeated-context reuse |
tokenCacheWrite | Tokens written to cache | Shows cache population, excluding extended cache creation |
The useful distinction: tokens are not your invoice
This is the catch that prevents a misleading dashboard. GitHub says the new numbers are raw counts without pricing or discount adjustments. Do not multiply them by a guessed token price and call the result spend. The response still includes billing-oriented values such as SKU, credits, quantities, gross amounts, discounts, and net amounts where the account and endpoint expose them. Use the token columns to explain behavior, then use the billing fields to reconcile spend.
That separation matters even more for teams experimenting with coding agents. A large tokenCacheRead figure can mean the system reused shared context efficiently. A large input count can instead mean that a repository, issue history, or generated diff is being sent repeatedly. Neither observation alone proves waste. Compare the fields against model, day, user, product, and cost center filters before acting.
How to query it without asking the wrong account
For an organization, the request path is /organizations/ORG/settings/billing/ai_credit/usage. GitHub documents optional year, month, day, user, model, and product filters. Organization callers need organization administration read access. Enterprise callers need the corresponding enterprise billing access. The documentation recommends the application/vnd.github+json Accept header and shows the current API-version header in its request examples.
Practical dashboard recipe
- Pull one day at a time so a late-arriving value does not blur a monthly trend.
- Group usage items by
model, then retain the product and SKU beside them. - Show input, output, cache read, cache write, image input, and image output as separate series.
- Display credits and net amount in a separate billing panel, not as a token conversion.
- Annotate the first days of any trend chart because pre-capture token fields return zero.
The historical-data edge case most dashboards will miss
GitHub says token counts generally start with usage on 1 December 2026. Customers who had early access can have partial earlier records. For dates before collection began, token fields return 0, not an estimated count. That means a chart that starts in November can show an artificial jump in December. Mark the collection boundary in the chart or limit token trendlines to the period after capture begins. For earlier detail, GitHub directs customers to the downloadable AI usage report from billing settings.
There is a broader operations lesson here. Teams that already tightened workflow safety after GitHub blocked risky pull_request_target workflows in public repositories can use this API to watch how their AI-assisted workflow changes afterward. And if your release process uses npm Publishing Plans for reviewed monorepo batches, keep that release telemetry separate from Copilot token telemetry. One measures a release decision, the other measures model traffic.
Where this fits in an agent-heavy developer workflow
Per-model token data is most valuable when it answers a decision you can actually make. Maybe one model produces better code review outcomes for the same task. Maybe image input spikes when a team begins using screenshot-driven debugging. Maybe cache reads rise after developers standardize their repository instructions. The API will not prove causation, but it gives engineering leaders a reliable starting point for a before-and-after comparison.
For browser automation and debugging, pair it with the instrumentation in Chrome DevTools MCP’s new logpoint and passkey testing tools. Usage volume tells you what the model consumed. Reproducible logs and browser tests tell you whether the work actually improved the outcome. That is a much sturdier operating loop than chasing a single monthly credit number.
FAQ
Who can see GitHub Copilot token counts?
GitHub says administrators on Copilot Business and Copilot Enterprise can access the relevant account-level data. People using Copilot for individuals can access their own user-level usage. The required endpoint depends on who pays for the license.
Do token counts show the price of each model call?
No. GitHub describes them as raw token counts without pricing or discount adjustments. Use them to understand traffic, and use the billing amounts returned by the account endpoint for financial reporting.
Why are older token fields zero?
Token collection generally begins with usage on 1 December 2026. GitHub states that earlier periods return zero unless the customer had early access with partial historical data.
The real prize is not a prettier Copilot bill. It is the chance to connect model choice, context strategy, and developer outcomes with evidence. If you run Copilot across a team, would you use this data first to set a budget, compare models, or redesign how agents receive repository context? Share the metric you would trust most, then pass this on to the person who owns your developer platform dashboard.


