Cost centers help you track and control GitHub costs by mapping them to your company's financial structure.
This tutorial guides you through planning, creating, and managing cost centers using both the user interface and the REST API, helping you decide which approach best fits your organization's needs.
As your enterprise grows, you can layer increasingly granular controls on top of cost centers to keep Copilot spending predictable:
- Group at scale. Assign whole enterprise teams to a cost center so membership stays current automatically as people join and leave.
- Cap per-user spending. Set a cost center user-level budget so every member of a cost center inherits the same per-person limit. See Budgets for usage-based billing.
1. Plan your cost center strategy
Cost centers allow you to group GitHub resources—users, enterprise teams, organizations, and repositories—for separate cost tracking and reporting. Each cost center should represent a segment of your company that you want to report on or control costs for as a separate entity.
If you use Azure billing, you can assign a different billing identity to each cost center.
Identify the cost centers you need
The best strategy depends on the complexity of both your financial reporting structure and your GitHub setup. Start with the simplest approach—you can always add more cost centers later.
Follow these steps to plan your cost centers:
-
Map to financial entities: Create one cost center for each financial entity you want to track internally (such as departments, business units, or project teams).
-
Identify users: List the users who belong to each financial entity. Assigning users directly to a cost center ensures their license and product usage is allocated correctly.
-
Identify enterprise teams: If you manage groups of users with enterprise teams, you can assign a whole team to a cost center instead of listing its members. Team membership flows into the cost center and stays current automatically.
-
Identify organizations: List the organizations that belong to each financial entity. Assigning organizations to a cost center allocates their usage of actions, Codespaces, packages, and other products correctly.
-
Identify mixed ownership: If an organization contains repositories owned by different financial entities, plan to assign individual repositories to the relevant cost centers and leave the organization unassigned.
Tip
If a user is directly assigned to cost center A, and indirectly part of cost center B by organization membership, all their costs for licensed products are allocated to cost center A. For more details and an example, see Cost center allocation for different products.
2. Create a cost center in the UI
Now you'll create your first cost center using the user interface (UI) to familiarize yourself with how cost centers work. Choose one of the cost centers you've identified as an example—it's best to start with a small financial entity.
- Navigate to your enterprise. For example, from the Enterprises page on GitHub.com.
- At the top of the page, click Billing and licensing.
- Click Cost centers.
- Click New cost center in the upper-right corner.
- In the text box under "Name", enter the name of the financial entity you want to track costs for.
- Optionally, if this financial entity has a separate Azure subscription, you can add the Azure subscription to the cost center to charge usage directly to it. The credentials will be verified against Azure to ensure the Azure ID associated with the account is available.
- Under Resources, select the users, enterprise teams, organizations, and repositories to track as part of this cost center.
- Click Create cost center.
Your new cost center is now active and usage will begin to attribute to the cost center immediately. Future billing reports will include this cost center with an entry in the cost_center_name column for usage allocated to it. You'll also be able to filter usage charts by this cost center.
You can assign an enterprise team to a cost center. Every member of the team is added to the cost center, and membership stays current automatically as people join or leave the team—so you don't have to add or remove users one by one. For more information about enterprise teams, see Creating enterprise teams.
3. Set budgets to control additional spending
Creating a cost center allows you to track costs separately for different financial entities. To actually control costs, you need to apply budgets to your cost centers.
Understanding budgets
Budgets give you control over spending. Each budget:
- Applies to a single organization, repository, cost center, or your entire enterprise
- Controls the monthly usage of one paid product, SKU, or group of SKUs
- Can be configured to stop usage or to only alert when the budget limit is reached