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/usageFields worth storing
| Field | Use | Note |
|---|---|---|
| day | Trend | UTC date |
| total_suggestions | Adoption | Volume, not value |
| total_acceptances | Acceptance rate | Quality signal |
| total_chat_turns | Chat usage | Includes agent calls |
| breakdown | Per-editor and per-language | Array 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.
- Create a token with the narrowest scope that reads billing.
- Fetch the usage summary for the period you need.
- Store the raw response before transforming it.
- 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.