Connecting to GitHub
Connect your GitHub Enterprise Cloud accounts to CloudZero to bring your GitHub cost data into a unified view of all your cloud and AI spend. CloudZero organizes your GitHub costs, along with your other costs, into categories (called Dimensions) that matter most to your business. For example: business unit, team, product, feature, environment, customer, or virtually anything else. Once connected and organized, you can quickly answer questions about your spend that matter to your stakeholders.
This guide covers creating credentials in GitHub, either a classic personal access token or a GitHub App, and configuring the connection in CloudZero. CloudZero pulls the usage and license charges on your enterprise bill from GitHub's Enhanced Billing Platform, including Copilot seats, Copilot premium requests and AI credits by user and model, and Actions, Packages, and Git LFS usage. The connection is read-only.
This connection supports GitHub Enterprise Cloud only. Organization-scoped billing accounts are not supported.
What you need
- CloudZero user with data configuration permissions
- A GitHub Enterprise Cloud account with the enterprise owner or billing manager role. Installing a GitHub App on the enterprise requires the enterprise owner role.
- For a personal access token, a dedicated service account to generate it. Tokens generated against a personal account surface CloudZero's automated reports on that user's GitHub activity page.
Step 1: Find your enterprise slug
Your enterprise slug is the identifier in your enterprise URL. For example, in https://github.com/enterprises/acme-corp, the slug is acme-corp.
- Sign in to GitHub as an enterprise owner or billing manager.
- Navigate to your enterprise account and copy the slug from the URL.
Step 2: Create credentials in GitHub
CloudZero connects with either a classic personal access token or an application that you register on your enterprise (called a GitHub App). Both give CloudZero the same read-only billing data. Use a GitHub App if your enterprise restricts classic personal access tokens or you want credentials that are not tied to a user.
Option A: Create a classic personal access token
For full details, see GitHub's personal access token documentation.
GitHub's enterprise billing endpoints require classic tokens (prefixed
ghp_). Fine-grained personal access tokens are not supported.
- In GitHub, navigate to Settings > Developer settings > Personal access tokens > Tokens (classic), or open your token settings directly.
- Select Generate new token (classic). Reauthenticate if prompted.
- Enter a descriptive Note (for example, "CloudZero Integration").
- Set an Expiration that matches your security policy.
- Under Select scopes, enable
manage_billing:enterprise. - Select Generate token.
- Copy the token and store it securely. GitHub does not display the token again after creation.
Option B: Register a GitHub App
Register a GitHub App with read-only access to your enterprise's billing data. For full details, see GitHub's Registering a GitHub App.
GitHub has not made the Enterprise billing permission generally available for GitHub Apps owned by an enterprise. If your App's permission settings do not list it, use Option A.
- In GitHub, start registering a new GitHub App under your enterprise account, not under an organization.
- Under Webhook, deselect Active. CloudZero does not use webhooks.
- Set the Enterprise billing permission to Read-only. CloudZero needs no other permissions.
- Finish registering the App.
- Copy the Client ID from the App's settings page.
- Generate a private key for the App. GitHub downloads it as a
.pemfile. Keep the key in this PEM format; CloudZero does not accept keys converted to OpenSSH format. For the steps, see GitHub's Managing private keys for GitHub Apps. - Install the App on your enterprise account. An enterprise owner must install it. For the steps, see GitHub's Installing a GitHub App on your enterprise.
Step 3: Configure the connection in CloudZero
- In CloudZero, go to Settings > Connections.
- Select Create Connection + and select the GitHub tile.
- Select Personal Access Token or GitHub App, matching the credentials you created in Step 2.
- Enter the connection details:
| Field | Value |
|---|---|
| Connection Name | A label that identifies the connection throughout CloudZero |
| Enterprise Slug | The slug from Step 1 |
| Personal Access Token | The token from Option A (personal access token only) |
| Client ID | The Client ID from Option B (GitHub App only) |
| Private Key (PEM) | The full contents of the .pem file from Option B, including the BEGIN and END lines (GitHub App only) |
| Fixed IP Egress | Optional; see Fixed IP egress |
- Select Test to confirm CloudZero can read your enterprise billing data.
- Select Create Connection.
What to expect
After you connect, CloudZero begins ingesting your GitHub cost and usage data. Your GitHub costs appear across the platform within 24 hours. Once data is available, you can view costs broken down by organization, repository, Actions workflow, user, Copilot seat holder, model, and any active Cost Centers you have configured in GitHub.
From there, your GitHub costs work like any other cost data in CloudZero. For example, you can organize them by team or product using Dimensions, track trends in Dashboards, set Budgets, or ask questions in the AI Hub.
Maintenance and configuration
Fixed IP egress
If your GitHub enterprise only accepts requests from approved IP addresses, select Use fixed IP egress on the CloudZero connection, then add the following addresses to your enterprise's IP allow list:
52.0.118.18052.0.33.11134.207.222.14934.193.111.240100.30.110.23454.85.9.23135.175.48.156100.50.61.179
See GitHub's IP allow list documentation.
For how fixed IP egress works, see Fixed IP egress.
Update credentials
You can rotate a token or switch between a personal access token and a GitHub App without creating a new connection. When you save, CloudZero checks that the new credentials are complete and correctly formatted. It does not test them against GitHub, so confirm the token scope or the App installation from Step 2 before you save.
- In CloudZero, go to Settings > Connections and select your GitHub connection.
- Select Edit.
- Under Credentials, select Personal Access Token or GitHub App.
- Enter the new credentials from Step 2. For a GitHub App, enter both the Client ID and the Private Key (PEM). Leave the fields empty to keep the current credentials.
- Select Save Changes.
Troubleshooting
GitHub export stuck generating
GitHub generates one billing report at a time for each enterprise. If a report stays in progress for more than 30 minutes, it blocks new billing data and the connection shows an error that starts with "GitHub export ... has been stuck generating." Only GitHub Support can clear a stuck export. Contact GitHub Support and give them the export ID from the error. CloudZero resumes ingestion once the export clears.
GitHub API returned 404
This error means GitHub could not find your enterprise's billing data with the credentials provided. Confirm the Enterprise Slug matches your enterprise URL and that the credentials have enterprise billing access: the manage_billing:enterprise scope for a personal access token, or the Enterprise billing permission and an installation on your enterprise for a GitHub App.
Connection details
Tags
The GitHub connection provides tags with the github_cz prefix for use in Dimensions:
| Tag | Description |
|---|---|
github_cz:cost_center | GitHub Cost Center the charge belongs to |
github_cz:repository | Repository that generated the usage |
github_cz:workflow_path | Actions workflow that generated the usage |
github_cz:user_login | GitHub user associated with the usage or license |
github_cz:copilot_user_login | Copilot user associated with the seat or request |
CloudZero assigns each charge to an active Cost Center by matching its repository first, then its user, then its organization.
Cloud Provider Dimensions
CloudZero maps your GitHub billing data to the following categories (called Cloud Provider Dimensions), which you can group and filter by across the platform:
| Dimension | Example values |
|---|---|
| Account | The GitHub organization, or Unknown-Account when GitHub does not report one |
| Service | The GitHub product: actions, copilot, packages, git_lfs, or codespaces |
| Usage Family | The GitHub SKU, such as actions_linux or Copilot AI Credits |
| Usage Type | The Copilot model, such as GPT-5.4, on Copilot model usage only |
| Resource | The seat, repository, or organization, for example copilot-seat/<login> or repository-<org>/<repo> |
Have questions or feedback? Reach out to your account manager.
Updated 3 days ago

