GitHub Copilot

GitHub Copilot usage API

Use the Copilot usage API to pull organization metrics: endpoints, authentication, pagination, and the fields that matter.

Quick answer

Organization owners can pull Copilot metrics from GitHub's REST API under the organization metrics endpoints, authenticated with a token that has the right admin scope. The API returns aggregated usage by day and editor, not per-prompt tokens. Check the current API version and endpoint names before building a pipeline.

Authentication

  • Use a fine-grained token or GitHub App with organization administration read access.
  • The caller must be an owner or have the billing role.
  • Send the standard Accept and API version headers.
  • Paginate; a full organization does not fit in one response.
curl -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/vnd.github+json" \
  https://api.github.com/orgs/ORG/copilot/usage

Fields worth storing

FieldUseNote
dayTrendUTC date
total_suggestionsAdoptionVolume, not value
total_acceptancesAcceptance rateQuality signal
total_chat_turnsChat usageIncludes agent calls
breakdownPer-editor and per-languageArray of objects

What the API does not give you

There is no per-token endpoint and no per-prompt record. If you need cost attribution, combine the API's per-user seat data with the credit usage shown in the organization report.

Endpoint names and response shapes change, so read the current REST documentation before shipping a client. The usage report guide covers the manual equivalent.

What the API returns

GitHub's billing and organization APIs expose seat and usage summaries, which is enough to automate a monthly report or a spend check. They return aggregates, not per-request detail, and the available fields differ between personal and organization scopes.

  1. Create a token with the narrowest scope that reads billing.
  2. Fetch the usage summary for the period you need.
  3. Store the raw response before transforming it.
  4. Alert on the field that actually blocks work.

Treat endpoint shapes as unstable and read the current documentation. For the manual route, see Copilot usage report.

Questions, answered

Is there a Copilot usage API?

Yes, for organizations with Copilot Business or Enterprise. It exposes aggregated metrics, not individual prompts.

Can individuals call the API for their own usage?

The metrics endpoints are organization-scoped. Individual usage is shown in account settings instead.

How far back does the API go?

It supports a date range within the retention the endpoint allows. Check the current documentation for the maximum span.

Browse by topic