Connecting to GitHub

Connect your GitHub Enterprise Cloud account to CloudZero to bring your GitHub cost and usage data into a unified view of all your cloud and SaaS 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 data from GitHub's Enhanced Billing Platform, including Copilot seat costs, per-user premium-request usage by 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.

  1. Sign in to GitHub as an enterprise owner or billing manager.
  2. 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.

  1. In GitHub, navigate to Settings > Developer settings > Personal access tokens > Tokens (classic), or open your token settings directly.
  2. Select Generate new token (classic). Reauthenticate if prompted.
  3. Enter a descriptive Note (for example, "CloudZero Integration").
  4. Set an Expiration that matches your security policy.
  5. Under Select scopes, enable manage_billing:enterprise.
  6. Select Generate token.
  7. 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.

  1. In GitHub, start registering a new GitHub App under your enterprise account, not under an organization.
  2. Under Webhook, deselect Active. CloudZero does not use webhooks.
  3. Set the Enterprise billing permission to Read-only. CloudZero needs no other permissions.
  4. Finish registering the App.
  5. Copy the Client ID from the App's settings page.
  6. Generate a private key for the App. GitHub downloads it as a .pem file. 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.
  7. 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

  1. In CloudZero, go to Settings > Connections.
  2. Select Create Connection + and select the GitHub tile.
  3. Select Personal Access Token or GitHub App, matching the credentials you created in Step 2.
  4. Enter the connection details:
FieldValue
Connection NameA label that identifies the connection throughout CloudZero
Enterprise SlugThe slug from Step 1
Personal Access TokenThe token from Option A (personal access token only)
Client IDThe 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)
  1. Select Create Connection.

What to expect

After you connect, CloudZero begins ingesting your GitHub cost and usage data. Your GitHub costs appear in Explorer and Analytics within 24 hours. Once data is available, you can view costs broken down by organization, repository, Copilot seat holder, model, and any 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.

Update credentials

You can rotate a token or switch between a personal access token and a GitHub App without creating a new connection. CloudZero validates the new credentials before it saves them and keeps using the current ones until then.

  1. In CloudZero, go to Settings > Connections and select your GitHub connection.
  2. Select Edit.
  3. Under Credentials, select Personal Access Token or GitHub App.
  4. Enter the new credentials from Step 2.
  5. Select Save Changes.
ℹ️

Have questions or feedback? Reach out to your account manager.


Did this page help you?