Connecting to GitHub
How the GitHub Connection works
The GitHub connection uses a classic personal access token (PAT) to pull cost and usage data from GitHub's Enhanced Billing Platform. After your connection is ingested, you will see your GitHub costs throughout the CloudZero platform — including Copilot seat costs, per-user premium-request usage by model, and Actions, Packages, and Git LFS usage — broken down by organization, repository, Copilot seat holder, model, and any Cost Centers you have configured in GitHub.
Supported GitHub Plans
This connection supports GitHub Enterprise Cloud only. Organization-scoped billing accounts are not currently supported.
Prerequisites for the GitHub Connection
Before you can connect CloudZero to GitHub, you must have the following:
- A GitHub Enterprise Cloud account with access to the Enhanced Billing Platform.
- Your enterprise slug, the unique identifier in your enterprise URL. For example, in
https://github.com/enterprises/acme-corp, the slug isacme-corp. - A classic personal access token (PAT, prefix
ghp_) with themanage_billing:enterpriseandmanage_billing:copilotscopes. Theread:enterprisescope is accepted as a fallback formanage_billing:copilot. - The enterprise owner or billing manager role on the account that generates the token.
Fine-grained personal access tokens (
github_pat_*) are not supported. GitHub's enterprise billing endpoints currently require classic PATs.
We recommend generating the PAT from a dedicated service account rather than a real user. Tokens generated against a personal account will surface CloudZero's automated reports on that user's GitHub activity page.
To connect CloudZero to GitHub, complete the following steps:
- Copy your enterprise slug.
- Create a classic personal access token in GitHub.
- Create the GitHub connection in CloudZero.
Step 1: Copy your Enterprise Slug
- Log in to GitHub as an enterprise owner or billing manager.
- Navigate to your enterprise account at
https://github.com/enterprises/<your-slug>and copy the value after/enterprises/.
For more information on enterprise accounts, see About your enterprise account.
Step 2: Create the Classic Personal Access Token
- In GitHub, navigate to Settings > Developer settings > Personal access tokens > Tokens (classic), or open your personal access token settings directly.
- Select Generate new token (classic). If prompted, reauthenticate.
- Enter a descriptive Note for the token, for example,
CloudZero Integration. - Set an Expiration that matches your security policy.
- Under Select scopes, enable both
manage_billing:enterpriseandmanage_billing:copilot. - Select Generate token.
- Copy the token immediately and store it securely. GitHub will not display it again.
Step 3: Create the CloudZero GitHub Connection
- In CloudZero, navigate to Cloud Integrations and select Add Connection.
- Select the GitHub tile and select Get Started.
- Enter a connection name.
- Enter your enterprise slug.
- Enter your personal access token.
- Select Connect.
After CloudZero processes the first ingest of billing and usage data, the connection Status will change from Pending Data to Healthy.
Updated 2 days ago
