GitHub Copilot
The github-copilot connector reads two things from GitHub:
- Billing: daily Copilot license charges per SKU, and AI Credits per model, in USD (billed).
- Copilot usage metrics reports: daily per-user Copilot activity (interactions, code generation, acceptances), with no cost.
It works on github.com and on GHE.com (GitHub Enterprise Cloud with data residency), in one of two modes:
| Mode | Use it when | Covers |
|---|---|---|
| Enterprise (set the enterprise slug) | You have a GitHub enterprise, and always on GHE.com | Every organization of the enterprise, including Copilot charges GitHub bills at the enterprise level |
| Organization (set only the organization) | A standalone organization on github.com, without an enterprise | That organization |
With an enterprise, prefer enterprise mode even if you only care about one organization. GitHub often bills Copilot at the enterprise level, with no organization attached, and organization mode can’t see those charges.
Before you start
| You need | Why |
|---|---|
| Copilot Business or Enterprise on the organization | The metrics reports only exist for these plans |
| Enterprise mode: to be an enterprise owner or billing manager | Required to read the enterprise’s Copilot metrics and billing |
| Organization mode: to be an organization owner | Required to read the organization’s Copilot metrics and billing |
| The Copilot usage metrics policy enabled | Without it, GitHub returns no metrics reports |
Find your GitHub address, organization and enterprise
- Enterprise slug (enterprise mode): the name in the enterprise URL, e.g.
acme-enterprisein…/enterprises/acme-enterprise. On GHE.com, this is always required. - Organization (organization mode only): the name in your organization’s URL, e.g.
acmeinhttps://github.com/acme. - GHE.com subdomain: only on GHE.com, the part before
.ghe.com. Forhttps://acme-corp.ghe.com, it isacme-corp. Leave it blank on github.com.
Enable the Copilot usage metrics policy
An enterprise owner (or, without an enterprise, an organization owner) opens the Copilot policies of the enterprise or organization settings and sets Copilot usage metrics to Enabled everywhere. Reports start from the day the policy is enabled.
Create a classic personal access token
Lore recommends a classic token, because GitHub does not document fine-grained token permissions for the billing usage endpoints.
- Sign in to GitHub (or your GHE.com address) as the owner described above.
- Open your profile picture → Settings → Developer settings → Personal access tokens → Tokens (classic).
- Click Generate new token → Generate new token (classic).
- Note:
lore-usage. Expiration: as your policy allows. Lore shows a sync error when it expires. - Select these scopes:
- Enterprise mode:
read:enterprise(the enterprise’s Copilot metrics) andmanage_billing:enterprise(the enterprise’s billing); - Organization mode:
read:org(Copilot metrics) andmanage_billing:copilot(the organization’s billing).
- Enterprise mode:
- Click Generate token and copy it. It is shown only once.
- On github.com, if your organization uses SAML single sign-on, click Configure SSO next to the token and Authorize it for the organization.
If Tokens (classic) is missing or token creation is blocked, your enterprise may restrict personal access tokens. This is common with Enterprise Managed Users on GHE.com. An enterprise owner can allow them under the enterprise’s Personal access tokens policies.
Connect it in Lore
In the Lore panel, open Usage Connectors → GitHub Copilot and fill in:
| Field | Value |
|---|---|
| Credential | The token from the previous step |
| Enterprise slug | Enterprise mode (required on GHE.com) |
| GitHub organization | Organization mode only, when there is no enterprise |
| GHE.com subdomain | Only on GHE.com (e.g. acme-corp) |
Click Connect. Lore checks the token with GitHub before saving, testing both Copilot metrics and billing, and tells you exactly what’s missing.
If the check fails
| Message | What to do |
|---|---|
| GitHub rejected this token (401) | The token was not copied whole, or it expired. Create a new one. |
| The token cannot read the enterprise’s Copilot usage metrics (403) | Add read:enterprise, and make sure the token belongs to an enterprise owner or billing manager. |
| The token cannot read Copilot usage metrics (403) | Organization mode: add read:org. Make sure the token belongs to an organization owner and, with SAML SSO, is authorized for the organization. |
| Copilot usage metrics are not available (404) | Check the enterprise or organization name, the Copilot plan, and the Copilot usage metrics policy. On GHE.com, check the subdomain. |
| The token can read Copilot metrics but not billing usage | Enterprise mode: add manage_billing:enterprise. Organization mode: add manage_billing:copilot. The token’s owner must be an owner or billing manager there. |
Fine-grained tokens
A fine-grained token with your organization as resource owner and the View Organization Copilot Metrics permission can read the metrics reports. If your organization requires approval, an org owner must approve it first. GitHub does not currently document which fine-grained permission grants billing usage, so the billing check may fail with a fine-grained token. In that case, use a classic token.
What to expect
- AI Credits are attributed per user: for each person with Copilot activity that day, Lore reads that person’s AI Credits per model. GitHub applies the included-usage discount to the enterprise as a whole, so each model’s net cost is allocated to people in proportion to their gross consumption, the usual FinOps allocation of a shared discount. Credits GitHub doesn’t attribute to an active user stay unattributed. Either way, each day sums to exactly the bill. Licenses (Business, Enterprise) are not attributed per user, and show as “Not per person” in the per-person view.
- Licenses are amortized from GitHub’s monthly total. GitHub’s daily license figures don’t add up to the month, so Lore takes each month’s total per SKU and spreads it evenly over the month’s days (over the days elapsed so far for the current month, recalculated on every sync). The days sum to exactly GitHub’s monthly figure.
- Cost comes from GitHub’s billing summary (licenses, per SKU) and AI Credits usage (per model), net of included usage. Those are the figures GitHub’s Billing and licensing page shows. The gross amount and the AI credit quantity are kept alongside.
- In enterprise mode, cost covers the whole enterprise. GitHub’s billing summary has no per-organization breakdown.
- Rows are keyed by GitHub login, which is not matched to Lore members’ emails.
- Lore syncs at most every 6 hours and re-reads the last 3 days. After a failed sync it retries on the next hourly pass. Usage metrics reports keep up to one year of history.
- Per-user AI Credits take one extra call per active person per day. A first 90-day backfill of a large enterprise can therefore span more than one sync pass, and it resumes where it stopped. GitHub allows about 5,000 API calls per hour per token owner. When that quota runs out, the connector shows Paused: vendor rate limit (not an error), keeps its progress, and resumes on the first sync after GitHub’s quota resets. Other tools using the same person’s token share that quota.
Revoke
Delete the token under Developer settings → Personal access tokens, then disconnect it in Lore.