GitHub
Connect your GitHub organization to track Actions, Packages, Copilot, Codespaces, and storage costs.
What StackSpend tracks
Once connected, StackSpend imports the following cost categories from GitHub's billing API:
- Actions compute minutes
- Packages data transfer
- Copilot costs
- Codespaces compute
- Storage costs
For GitHub Copilot, StackSpend also imports usage metrics into the AI Explorer: per-member token usage (input and output) for Copilot CLI and the Copilot app, and which models each member uses in the IDE. GitHub does not report token counts per model, or tokens for IDE completions and chat, so model usage appears as interaction counts rather than tokens. This needs two extra settings — see Copilot usage in the AI Explorer below.
Data updates daily.
Prerequisites
- A GitHub organization account — personal accounts are not supported by the billing API
- Organization owner or admin access
Setup
Create a Personal Access Token
Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic).
Grant the following scopes:
admin:orgmanage_billing:enterprise— required if using GitHub Enterprisemanage_billing:copilot
Add to StackSpend
Go to Providers → Add provider → GitHub. Enter your organization name and the Classic PAT you just created. Click Save.
Verify
The first sync runs automatically after saving and backfills roughly the last 90 days, so you get history straight away rather than starting from zero. After that, data updates daily in line with GitHub's billing API.
Copilot usage in the AI Explorer
Copilot spend syncs as soon as you connect — nothing extra to do. To also see who is using Copilot and how much in the AI Explorer, two settings are needed:
- Turn on Copilot usage metrics. In GitHub, go to your organization's Settings → Copilot → Policies and enable Copilot usage metrics. GitHub only generates the per-member reports once this is on.
- Allow read access to those metrics. On a Classic PAT connection, the
admin:orgscope from the setup steps already includes this (it coversread:org). If you connected with the StackSpend GitHub App, the App needs the "Organization Copilot metrics: Read" permission — GitHub emails an organization owner to approve it, and member-level usage appears on the next sync after they do.
Two limits worth knowing, both set by GitHub rather than StackSpend: token counts are reported for Copilot CLI and the Copilot app but not yet for IDE completions or chat, and in some enterprise-owned organizations GitHub withholds per-member data from organization admins entirely.
Data availability
| Property | Value |
|---|---|
| Latency | Daily |
| Historical data | ~90 days backfilled on first sync |
| Setup time | ~3 minutes |
Frequently asked questions
What credentials do I need to connect GitHub?
You need a GitHub Classic personal access token (PAT) with the admin:org and manage_billing:copilot scopes, created by an organization owner or admin. Fine-grained tokens do not support the org billing API, so you must use a Classic PAT.
Can I connect a personal GitHub account?
No. Only organization accounts are supported because GitHub's billing API does not expose personal account billing data. You must be an organization owner or admin to connect.
What GitHub costs does StackSpend track?
StackSpend imports Actions compute minutes, Packages data transfer, Copilot costs, Codespaces compute, and storage costs from GitHub's billing API, plus per-member Copilot token usage and model mix from GitHub's Copilot usage metrics for the AI Explorer. On the GitHub Business plan it also reads source control activity — deploys and pull requests — so a cost anomaly can be traced back to the PR or deploy behind it.
Is there historical backfill?
Yes. The first sync backfills roughly the last 90 days, then data updates daily in line with GitHub's billing API. Free tier usage is automatically excluded, so only paid usage appears in StackSpend. Copilot per-member usage backfills over the same window once Copilot usage metrics are enabled.