Home / Blog / Per-model token breakdown in the AI usage REST API
Tech News

Per-model token breakdown in the AI usage REST API

GitHub's billing REST API now returns six per-model token counts, including cache reads and image tokens, for usage starting on December 1, 2026.

By Dillip Chowdary • Dec 02, 2026 • Source: GitHub Changelog

Per-model token breakdown in the AI usage REST API
Image: GitHub Changelog

At a glance

Platform
GitHub AI usage REST API
Release date
December 2, 2026
Telemetry start
December 1, 2026
New fields
6 raw per-model token counters
Eligible plans
Copilot Business, Enterprise, Individuals
Auth changes
None; existing permissions apply

GitHub updated its AI credit billing REST API endpoints to return a granular, per-model breakdown of raw token counts behind Copilot and AI credit consumption, according to GitHub Changelog's report. Previously, teams needing exact token counts across models had to download the manual AI usage report from billing settings rather than pulling the figures programmatically.

This update guide covers the three updated REST endpoints, the six new token fields added to each usage item, eligibility across Copilot plans, and the December 1 start date for token telemetry capture.

01Updated AI credit usage REST endpoints

Three billing usage endpoints now expose per-model token metrics directly in JSON responses without requiring any permission changes for existing API consumers. Administrators and developers can query the data at the enterprise, organization, or individual user level depending on how Copilot billing is scoped.

Command
GET /enterprises/{enterprise}/settings/billing/ai_credit/usage
GET /organizations/{org}/settings/billing/ai_credit/usage
GET /users/{username}/settings/billing/ai_credit/usage

The new token fields respect all existing endpoint query filters, including time period, user, and model. That lets FinOps and engineering platform teams slice token consumption by developer or specific foundation model inside internal dashboards.

02Six raw token fields in responses

Each usage record now includes six unadjusted token counters matching the exact definitions used in GitHub's downloadable AI usage report. Because the counts reflect raw model token consumption without pricing or discount adjustments, organizations can reconcile credit spend against exact prompt, completion, image, and cache behavior.

Token fieldMeaning in REST API responseBefore vs after change
tokenInputInput tokens sent to the modelPreviously report-only; now in API
tokenOutputOutput tokens generated by the modelPreviously report-only; now in API
tokenImageInputImage input tokens sent to the modelPreviously report-only; now in API
tokenImageOutputImage output tokens generated by the modelPreviously report-only; now in API
tokenCacheReadCached tokens read by the modelPreviously report-only; now in API
tokenCacheWriteCache write tokens excluding extended cache creationPreviously report-only; now in API

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

03Plan eligibility and zero permission changes

Access to the per-model token fields mirrors existing billing API permissions, meaning integrations already polling the enterprise, organization, or user endpoints receive the fields automatically. No new OAuth scopes or fine-grained personal access token permissions need to be granted to existing automation scripts.

Token counts are available to administrators on Copilot Business and Copilot Enterprise plans, as well as to any developer querying their own usage on Copilot for individuals. Separating tokenCacheRead and tokenCacheWrite lets teams verify whether multi-turn coding sessions are effectively hitting prompt caches or generating repeated uncached input charges, while tracking tokenImageInput and tokenImageOutput clarifies multimodal credit consumption.

04Telemetry cutoff starting December 1

GitHub noted that token count capture generally begins with usage recorded on December 1, 2026. Some customers who participated in early access may see partial token records predating December 1, while all other historical periods return 0 in the new token fields.

Engineering teams building automated cost-allocation pipelines should also confirm they are referencing GitHub's updated enterprise, organization, and personal billing usage REST API documentation to handle pagination and date-range filters consistently.

Note: For usage periods prior to December 1, 2026 where the REST API returns 0 for token fields, teams must still download the AI usage report from the AI usage page in GitHub billing settings.

05Integrating token metrics into cost dashboards

Engineering managers and platform teams tracking AI credit burn across multiple models should update JSON parsers to ingest the six new integer fields and filter out pre-December 1 zeros before computing cost-per-token ratios.

  1. Query the scoped billing endpoint Call the enterprise, organization, or user /settings/billing/ai_credit/usage endpoint using your existing billing-read credentials and model or date filters.
  2. Parse all six raw token counters Record tokenInput, tokenOutput, tokenImageInput, tokenImageOutput, tokenCacheRead, and tokenCacheWrite separately without assuming discount pricing is applied.
  3. Handle pre-December 1 historical gaps Treat zeroed token counts on queries before December 1, 2026 as uncaptured API history and pull legacy CSV/report exports from billing settings when auditing earlier months.

Frequently asked questions

Which GitHub REST API endpoints return the new per-model token breakdown?

The token counts are returned by GET /enterprises/{enterprise}/settings/billing/ai_credit/usage, GET /organizations/{org}/settings/billing/ai_credit/usage, and GET /users/{username}/settings/billing/ai_credit/usage.

What six token fields were added to each usage item?

Each usage item includes tokenInput, tokenOutput, tokenImageInput, tokenImageOutput, tokenCacheRead, and tokenCacheWrite without pricing or discount adjustments.

Why do token counts return 0 for older dates in the GitHub API?

Token counts generally begin with usage on December 1, 2026; periods before capture started return 0, though early-access customers may see partial earlier data.

Do teams need new API permissions to read Copilot token breakdowns?

No. Existing users of the enterprise, organization, or user billing usage endpoints receive the new fields automatically with no permission changes.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →