Copilot Usage Metrics API: Power-User Guide to Per-User PR Activity and Token Data

Last updated: December 5, 2026

The GitHub Copilot usage metrics API now reports pull request activity per user. Since December 4, 2026, user-level 1-day and 28-day reports show how many pull requests each person created, reviewed and merged with Copilot cloud agent or code review, while AI credit endpoints add per-model token counts.

Contents

What GitHub released

GitHub shipped two related reporting updates in the first week of December 2026. On December 4, the user-level reports in the Copilot usage metrics API gained a pull_requests object for enterprises and organizations (GitHub Changelog). Before, pull request metrics existed only in aggregate reports.

On December 2, the AI credit usage REST endpoints started returning six raw token counts for each usage item, so you can see the tokens behind your AI credits by model (GitHub Changelog). Together, they connect who shipped work with Copilot to what that work consumed.

For billing basics, see our guide to GitHub Copilot cost.

Endpoints and access

The usage metrics endpoints do not return metrics directly. Each call returns signed download links to NDJSON report files plus the report_day, and the links expire after a limited time (GitHub Docs). Reports are available from October 10, 2025, with up to one year of history.

Report Organization endpoint (GET) What it contains
Org summary, 1 day /orgs/{org}/copilot/metrics/reports/organization-1-day?day=YYYY-MM-DD One aggregated record, including pull_requests
Org summary, 28 days /orgs/{org}/copilot/metrics/reports/organization-28-day/latest Daily records in day_totals
Users, 1 day /orgs/{org}/copilot/metrics/reports/users-1-day?day=YYYY-MM-DD One record per user, now with pull_requests
Users, 28 days /orgs/{org}/copilot/metrics/reports/users-28-day/latest A record per user per day in the window
User-teams, 1 day /orgs/{org}/copilot/metrics/reports/user-teams-1-day?day=YYYY-MM-DD User-to-team mapping for team rollups
Repositories, 1 day /orgs/{org}/copilot/metrics/reports/repos-1-day?day=YYYY-MM-DD One record per repository with pull request activity

Enterprise versions use the same report names under /enterprises/{enterprise}/copilot/metrics/reports/. For organization reports, classic tokens need the read:org scope, and fine-grained tokens need the “Organization Copilot metrics” read permission. Enterprise reports need manage_billing:copilot or read:enterprise (GitHub Docs).

How to pull per-user PR activity

  1. Confirm the Copilot usage metrics policy is enabled. For enterprise endpoints, GitHub Docs says it must be set to Enabled everywhere.
  2. Create a token. Use a fine-grained token with “Organization Copilot metrics” read access, or a classic token with read:org.
  3. Request the users report for a finished UTC day, sending Accept: application/vnd.github+json and X-GitHub-Api-Version: 2026-03-10.
  4. Download every URL in download_links promptly, since the signed links expire.
  5. Parse each NDJSON line as one user record and read user_login, ai_credits_used and the pull_requests object.
  6. Join the result with the user-teams report for the same day to build team totals.
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  "https://api.github.com/orgs/ORG/copilot/metrics/reports/users-1-day?day=2026-12-03"

A 204 response on the 1-day organization, repository and user-teams endpoints means no content was returned for that day (GitHub Docs).

The new pull request fields

Each user row now carries seven integer counts. Field names match the existing pull_requests section of the aggregate reports (GitHub Changelog):

Field Meaning for the user on that day
total_created Pull requests created, including those Copilot cloud agent created for the user who started it
total_created_by_copilot Subset of created pull requests made by Copilot cloud agent
total_reviewed Pull requests the user reviewed, excluding their own
total_reviewed_by_copilot The user’s pull requests reviewed by Copilot code review
total_merged The user’s pull requests merged
total_merged_created_by_copilot Merged pull requests that Copilot cloud agent created
total_merged_reviewed_by_copilot Merged pull requests that Copilot code review reviewed

Counts describe the record’s day in UTC. The object is null or omitted when client_telemetry_present is false, and users with no activity show zeros (GitHub Docs). Per-user rows also include ai_credits_used, which GitHub describes as a consumption figure, not an invoicing total.

The review fields pair well with our Copilot code review API guide and the adaptive review effort guide.

Per-model token counts for AI credits

The AI credit usage endpoints are 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 (GitHub Changelog). Each usage item now adds these raw counts, without pricing or discount adjustments:

  • tokenInput and tokenOutput: text tokens sent to and generated by the model.
  • tokenImageInput and tokenImageOutput: image tokens in and out.
  • tokenCacheRead: cached tokens read by the model.
  • tokenCacheWrite: tokens written to the cache, excluding extended cache creation.

The existing filters still apply: year, month, day, user, model and product, with up to 24 months of data (GitHub Docs). The organization endpoint needs the “Administration” organization read permission, and the user endpoint needs the “Plan” user read permission.

gh api "/organizations/ORG/settings/billing/ai_credit/usage?year=2026&month=12&model=GPT-5" \
  --jq '.usageItems[] | {model, netQuantity, tokenInput, tokenOutput, tokenCacheRead}'

Practical workflows

  • Agent adoption by person: divide total_merged_created_by_copilot by total_merged per user over 28 days to see who merges cloud agent work.
  • Review coverage: compare total_reviewed_by_copilot with total_created to find authors whose pull requests skip Copilot code review.
  • Cost per merged pull request: sum ai_credits_used per user and set it against merged pull requests.
  • Cache efficiency by model: compare tokenCacheRead with tokenInput per model to see which models benefit from caching.

Before and after the update

Question Before December 2026 Now
Pull requests per user Only aggregate org, enterprise or repository totals pull_requests object in each user row
Copilot share of a user’s merges Required combining separate data sources total_merged_created_by_copilot per user
Tokens behind AI credits Downloaded AI usage report Six token fields in the REST response
Filter tokens by model or user Not available in the API Existing model and user filters

Limitations and reconciliation

  • Copilot-active users only: users appear on days they used Copilot, so user totals can be lower than organization totals (GitHub Changelog).
  • Bot pull requests: pull requests from bots other than Copilot cloud agent are not attributed to any user.
  • Double-counted reviews: a pull request with two reviewers counts once for each, so summed total_reviewed can exceed the aggregate.
  • No median merge time: median_minutes_to_merge stays in the enterprise, organization and repository reports.
  • Token history: token counts generally start with December 1, 2026 usage and return 0 before then; early-access customers may have partial earlier data.
  • Scope differences: organization and enterprise totals can differ because of deduplication and attribution timing.

For supply chain checks that also run inside Copilot code review, see our dependency scans guide.

Frequently asked questions

What changed in the Copilot usage metrics API in December 2026?

On December 4, 2026, GitHub added a pull_requests object to the user-level 1-day and 28-day reports for enterprises and organizations. On December 2, GitHub added six raw token counts per model to the AI credit usage endpoints.

Who can call the Copilot usage metrics API?

Enterprise owners and billing managers, organization owners, and anyone with a custom role granting View Organization Copilot Metrics or View Enterprise Copilot Metrics. The Copilot usage metrics policy must be enabled.

Do I need new permissions for the per-model token counts?

No. GitHub says the new token fields appear in existing enterprise, organization and user AI credit usage responses with no permission changes. They are available to admins on Copilot Business and Enterprise and to anyone on Copilot for individuals.

Why do my token counts show zero for November?

Token counts generally start with usage on December 1, 2026, and fields return 0 for periods before capture began. For earlier detail, download the AI usage report from the AI usage page in billing settings.

Why do per-user pull request totals not match the organization total?

Users appear only on days they used Copilot, and pull requests from bot accounts other than Copilot cloud agent are not attributed to a user. Reviews also count once per reviewer, so summed review counts can exceed the aggregate.

Sources

Related answers

Leave a Comment