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:

  1. A GitHub Enterprise Cloud account with access to the Enhanced Billing Platform.
  2. Your enterprise slug, the unique identifier in your enterprise URL. For example, in https://github.com/enterprises/acme-corp, the slug is acme-corp.
  3. A classic personal access token (PAT, prefix ghp_) with the manage_billing:enterprise and manage_billing:copilot scopes. The read:enterprise scope is accepted as a fallback for manage_billing:copilot.
  4. 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:

  1. Copy your enterprise slug.
  2. Create a classic personal access token in GitHub.
  3. Create the GitHub connection in CloudZero.

Step 1: Copy your Enterprise Slug

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

  1. In GitHub, navigate to Settings > Developer settings > Personal access tokens > Tokens (classic), or open your personal access token settings directly.
  2. Select Generate new token (classic). If prompted, reauthenticate.
  3. Enter a descriptive Note for the token, for example, CloudZero Integration.
  4. Set an Expiration that matches your security policy.
  5. Under Select scopes, enable both manage_billing:enterprise and manage_billing:copilot.
  6. Select Generate token.
  7. Copy the token immediately and store it securely. GitHub will not display it again.

Step 3: Create the CloudZero GitHub Connection

  1. In CloudZero, navigate to Cloud Integrations and select Add Connection.
  2. Select the GitHub tile and select Get Started.
  3. Enter a connection name.
  4. Enter your enterprise slug.
  5. Enter your personal access token.
  6. Select Connect.

After CloudZero processes the first ingest of billing and usage data, the connection Status will change from Pending Data to Healthy.