> For the complete documentation index, see [llms.txt](https://docs.finout.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finout.io/billing-integrations/data-and-engineering-platforms/connect-to-github.md).

# Connect to GitHub

## Connect to GitHub (Beta)

{% hint style="warning" %}
**Note:** This integration is currently in beta. If GitHub isn't available yet in your account, contact Finout support at <support@finout.io> to enable it.
{% endhint %}

#### Overview

Finout's GitHub integration ingests billing data across **Actions, Copilot, Codespaces, Git LFS, Shared Storage, and Packages**, so your GitHub spend appears alongside your other cloud and SaaS costs in [MegaBill](https://docs.finout.io/user-guide/inform/megabill).

With this integration, you can:

* See GitHub costs broken down by **service** (Actions, Copilot, Codespaces, etc.), **SKU**, **organization**, and **repository**, as well as service-specific fields like **Copilot Model**
* See both the **net billed cost** and the **list cost before discounts** for each service
* See **usage quantity** alongside cost, in each service's native unit (minutes, seats, AI credits, GB)

{% hint style="info" %}
The token scopes this integration requires (`manage_billing:enterprise` and `manage_billing:copilot`) grant GitHub billing and Copilot management access at the enterprise level, since this is the minimal privilege required to report costs and usage.

Finout **only ever reads** billing and usage data with this token — it never modifies billing settings, Copilot seats, repositories, code, or any other GitHub resource.
{% endhint %}

#### Before you start

This integration supports **GitHub Enterprise Cloud accounts only**. Organizations on the GitHub Teams or Free plans aren't supported, since enterprise-level billing data isn't available on those plans.

Authentication uses a **Classic Personal Access Token (PAT)**. Fine-grained tokens aren't supported, since GitHub doesn't expose billing data to fine-grained tokens.

You'll need:

* A GitHub Enterprise Cloud account
* Permission to assign the **Enterprise Owner** or **Billing Manager** role to a GitHub account
* Admin access in Finout

#### Step 1: Create a dedicated service account in GitHub

{% hint style="success" %}
**Recommended:** Use a dedicated service account rather than a personal account, so the integration doesn't break if that person leaves or loses access.
{% endhint %}

1. **Create** a new GitHub account using a shared email address (for example, `finout-integration@yourcompany.com`). This account doesn't need access to any repository or source code — only billing permissions.
2. **Assign** the account one of the following roles on your GitHub Enterprise account:

| Role                 | What it allows                                                           |
| -------------------- | ------------------------------------------------------------------------ |
| **Enterprise Owner** | Full access to enterprise billing data across all organizations          |
| **Billing Manager**  | Read access to enterprise billing data — sufficient for this integration |

To assign the role, go to **github.com > your Enterprise > Settings > People > Invite member** (or **Manage roles** for an existing account).

If you'd rather use a personal account, you can skip creating a service account — just make sure that account already holds the Enterprise Owner or Billing Manager role.

#### Step 2: Generate a Classic Personal Access Token

While logged in as the service account (or the personal account you're using):

1. **Click** your profile picture (top right) **> Settings**.
2. Scroll to the bottom of the left sidebar and **click Developer settings**.
3. **Click Personal access tokens > Tokens (classic)**.
4. **Click Generate new token > Generate new token (classic)**.
5. **Fill in** the token fields:

| Field       | Value                                                                                 |
| ----------- | ------------------------------------------------------------------------------------- |
| Note (name) | `Finout Billing Integration` (or any descriptive name)                                |
| Expiration  | 1 year recommended — set a calendar reminder to rotate it before it expires           |
| Scopes      | `manage_billing:enterprise` and `manage_billing:copilot` — no other scopes are needed |

6. **Click Generate token**.
7. **Copy** the token immediately — GitHub only shows it once.

{% hint style="info" %}
`manage_billing:enterprise` grants access to GitHub billing costs (Actions, Copilot, Codespaces, and so on). `manage_billing:copilot` grants access to Copilot usage metrics. Both scopes must be on the same token.
{% endhint %}

#### Step 3: Find your GitHub Enterprise slug

The enterprise slug identifies which GitHub Enterprise account to connect.

1. While logged in to GitHub, **navigate** to your Enterprise account.
2. **Copy** the part of the URL after `/enterprises/` — for example, in `github.com/enterprises/acme-corp`, the slug is `acme-corp`.

If you're not sure which URL to use, go to github.com, click your profile, then **Your enterprises** — the slug appears in the URL once you select your enterprise account.

#### Step 4: Connect GitHub to Finout

1. In Finout, **navigate to Settings > Cost Centers** and **click Add Cost Center**.

   > 📸 SCREENSHOT NEEDED — Cost Centers page with the Add Cost Center button visible Suggested caption: Settings > Cost Centers Where in product: Settings > Cost Centers
2. **Find GitHub** and **click Connect Now**. The Connect GitHub wizard opens. \[VERIFY: exact field labels and wizard copy against the Figma once built — the PRD's Figma link was still TBD at the time of drafting.]

   > 📸 SCREENSHOT NEEDED — Connect Accounts modal with GitHub tile highlighted Suggested caption: Selecting GitHub from Connect Accounts Where in product: Settings > Cost Centers > Add Cost Center
3. **Enter** the following details:

| Field                 | Description                                                                                         |
| --------------------- | --------------------------------------------------------------------------------------------------- |
| Cost Center Name      | A name for this Cost Center in Finout. Defaults to `GitHub`.                                        |
| Enterprise Slug       | The slug you copied in Step 3.                                                                      |
| Personal Access Token | The Classic PAT you generated in Step 2. Stored as a secret and never displayed again after saving. |

> 📸 SCREENSHOT NEEDED — Connect GitHub form with Cost Center Name, Enterprise Slug, and Personal Access Token fields Suggested caption: GitHub connection details Where in product: Settings > Cost Centers > Add Cost Center > GitHub > Connect Now

4. **Click Next**. Finout validates the credentials with a lightweight call to the billing API before saving.

If validation fails, Finout shows one of the following errors:

| Error                                      | Message to you                                                                                                                   |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| Invalid or wrong token                     | Authentication failed. Please check your token and try again.                                                                    |
| Wrong enterprise slug or insufficient role | Enterprise Slug not found. Check your enterprise slug and ensure your token has Enterprise Owner or Billing Manager permissions. |
| Missing scopes on token                    | Your token is missing required permissions. Ensure it includes `manage_billing:enterprise` and `manage_billing:copilot` scopes.  |
| Invalid slug format                        | Invalid enterprise slug format. Please check and re-enter.                                                                       |

If validation passes, the connection is saved and an initial data sync begins automatically.

> 📸 SCREENSHOT NEEDED — Success state after clicking Next, showing the Cost Center created Suggested caption: GitHub Cost Center created Where in product: Settings > Cost Centers

#### What happens next

On first connection, Finout pulls the current month plus up to two previous full months of billing data, so you have historical context from day one. After that, GitHub costs refresh daily — each run fetches the last 7 days of data to capture any retroactive adjustments GitHub makes to prior days.

#### Editing your integration

You can update your Enterprise Slug or Personal Access Token at any time from **Settings > Cost Centers**. All fields are editable, and historical data is preserved when you update credentials. The token field shows as a secret — you'll need to re-enter the whole token to update it.

> 📸 SCREENSHOT NEEDED — Edit view of an existing GitHub Cost Center with the token field masked Suggested caption: Editing an existing GitHub integration Where in product: Settings > Cost Centers > \[GitHub Cost Center] > Edit

#### FAQs

**Why doesn't Finout support GitHub Team or Free plans?**

Enterprise-level billing data — the source this integration reads from — is only exposed by GitHub on Enterprise Cloud accounts. GitHub doesn't expose an equivalent billing API for Team or Free plans.

**Does this integration give Finout access to my repositories or code?**

No. The token scopes used (`manage_billing:enterprise` and `manage_billing:copilot`) grant enterprise billing and Copilot management access — per GitHub's own scope definitions, `manage_billing:enterprise` technically permits both reading and writing billing data, and `manage_billing:copilot` technically permits managing Copilot seats. Neither scope grants any access to repositories or code. Finout only uses this token to read billing and usage data — it never writes to your GitHub billing settings, Copilot seats, or any other resource.

**Why is Repository Name empty for some line items?**

GitHub only attributes a repository to certain charges (for example, Actions minutes). Org-level charges, such as Copilot seats, aren't tied to a single repository, so `repositoryName` is empty for those rows.

**What happens if my Personal Access Token expires?**

Once the token expires or is revoked, GitHub data stops refreshing. Generate a new Classic PAT with the same scopes and update it from **Settings > Cost Centers** — if any days were missed in the meantime reach out to Finout Support to backfill them.

***

{% hint style="info" %}
**Need help?** If you run into any issues during setup, contact our support team at <support@finout.io> — we're happy to help.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.finout.io/billing-integrations/data-and-engineering-platforms/connect-to-github.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
