Skip to main content

About billing for GitHub Codespaces

View pricing and see how to manage GitHub Codespaces billing for your organization.

Who can use this feature

To manage billing for GitHub Codespaces for an organization, you must be an organization owner or a billing manager.

GitHub Codespaces is available for organizations using GitHub Team or GitHub Enterprise Cloud. GitHub Codespaces is also available as a limited beta release for individual users on GitHub Free and GitHub Pro plans. For more information, see "GitHub's products."

GitHub Codespaces pricing

Charges are incurred for the use of GitHub Codespaces for repositories owned by organization and enterprise accounts on GitHub Team and GitHub Enterprise. These accounts do not include any free minutes or storage for GitHub Codespaces. Personal accounts are not currently billed for GitHub Codespaces usage.

A GitHub Codespaces instance (a "codespace") incurs charges for compute time, while it is active, and for the amount of storage it uses on disk.

GitHub Codespaces usage is billed according to the units of measure in the following table:

ComponentMachine typeUnit of measurePrice
Codespaces compute2 core1 hour$0.18
4 core1 hour$0.36
8 core1 hour$0.72
16 core1 hour$1.44
32 core1 hour$2.88
Codespaces storageStorage1 GB-month*$0.07

* See "Billing for storage usage" below for details of the GB-month unit of measure.

If you enable prebuilding of codespaces this will incur additional charges. For more information, see "Billing for Codespaces prebuilds."

About billing for GitHub Codespaces

GitHub Codespaces is billed in US dollars (USD) according to the amount of compute time and storage space your codespaces use. Costs for GitHub Codespaces are always billed monthly, even if your account is otherwise billed annually.

Your GitHub Codespaces usage shares your organization or enterprise account's existing payment method, and receipt. For more information, see "Viewing your subscriptions and billing date."

Billing for compute usage

The compute usage of a codespace is the number of minutes for which that codespace is active. Total compute usage is calculated by summing the number of minutes used by all codespaces that are billable to the organization or enterprise. These totals are reported to the billing service every hour, and are billed monthly.

As an example, if a codespace is active for 1 hour and 15 minutes, then the compute cost will be the hourly cost of the codespace, as determined by its machine type, multiplied by 1.25.

You can restrict compute usage by stopping your codespaces. For information, see "Stopping and starting a codespace." Codespaces are stopped automatically after a configurable period of inactivity. The timeout period can be configured by the user, or at the organization level. For more information, see "Setting your timeout period for GitHub Codespaces" and "Restricting the idle timeout period."

Billing for storage usage

For GitHub Codespaces billing purposes, storage compromises the disk space used by all of the codespaces and prebuilds in your account. This includes any files used by the codespaces, such as cloned repositories, configuration files, and extensions, among others. Storage is billed for all of your existing codespaces, regardless of whether they are active or stopped. The storage billing for a codespace ends when it is deleted.

Codespace storage is reported in GB-months. Your billing month runs from a fixed day in one month until the same day in the next month. In most cases the day of the month is determined by the day you started on your current GitHub plan. Your GB-month storage, is calculated as follows. Once every hour, the storage used by all of your currently active and stopped codespaces is assessed. This figure is then divided by the number of hours in the current billing month: total storage size / hours this month. The result is added to the running total for codespace storage for the month.

For example, if you have one codespace that uses 100 GB of storage and has existed for one hour you will have used 100 / (24 * 30) = 0.1388 GB-months of storage in a 30-day month. If your use of GitHub Codespaces during a 30-day month consists of two 100 GB codespaces that both existed for three full days then there will be 24 * 3 hourly reports for the storage of these codespaces, giving a total of: (24 * 3) * 200 / (24 * 30) = 20 GB-months.

For each hourly report, the storage usage for the previous hour is calculated in seconds. As a result, you won't be charged for a full hour of storage if a codespace did not exist for the full 60 minutes. At the end of the month, GitHub rounds your storage to the nearest MB.

As an organization owner, you can:

  • List the currently active and stopped codespaces for your organization. For more information, see "Listing the codespaces in your organization." In addition to the cost of these codespaces, the cost of GitHub Codespaces for the current month may include costs for codespaces that existed earlier in the current month but have since been deleted.
  • See the total GitHub Codespaces compute and storage usage for your organization for the current month to date. For more information, see "Viewing your GitHub Codespaces usage."
  • Configure your organization settings to manage the cost of GitHub Codespaces. For more information, see "Managing the cost of GitHub Codespaces in your organization."

To estimate the costs for metered services, you can use the GitHub pricing calculator.

Billing for Codespaces prebuilds

A prebuild assembles the main components of a codespace for a particular combination of repository, branch, and devcontainer.json configuration file. It provides a quick way to create a new codespace. For complex and/or large repositories in particular, you can create a new codespace more quickly by using a prebuild. For more information, see "About GitHub Codespaces prebuilds."

GitHub Actions costs for prebuilds

Prebuilds are created and updated by running a GitHub Actions workflow on a GitHub-hosted runner. By default, prebuilds are updated every time you modify the prebuild configuration, or push changes to a prebuild-enabled branch. As with other workflows, while prebuild workflows are running they will either consume some of the Actions minutes included with your account, if you have any, or they will incur charges for Actions minutes. For more information about pricing for Actions minutes, see "About billing for GitHub Actions." There is no associated Codespaces compute cost for creating or updating prebuilds.

To reduce consumption of Actions minutes, you can set a prebuild to be updated only when you make a change to your dev container configuration files, or only on a custom schedule. You can also manage your storage usage by adjusting the number of previous versions of each prebuild that are retained. For more information, see "Configuring prebuilds."

If you are an organization or enterprise owner, you can track usage of prebuild workflows and storage by downloading a usage report for your organization or enterprise. You can identify workflow runs for prebuilds by filtering the CSV output to only include the workflow called "Create GitHub Codespaces Prebuilds." For more information, see "Viewing your GitHub Actions usage."

Storage costs for prebuilds

In addition to GitHub Actions minutes, you will also be billed for the storage of prebuilds associated with each prebuild configuration for a given repository and region. Storage of prebuilds is billed at the same rate as storage of codespaces.

The storage cost for a prebuild in a single region will be similar to the storage cost that will be incurred for storing a single codespace created from that prebuild. The storage cost for the generated codespace may be more than the cost for the prebuild if, for example, the updateContentCommand and postCreateCommand commands are used during codespace creation to download more files to the dev container.

The total storage costs associated with a prebuild will depend on:

  • The price of storage per GB. See the table above.
  • The size of the generated prebuild in GB.
  • The number of regions in which the prebuild is available (because a copy of the prebuild is stored in each region).
  • The number of older versions of the prebuild that are retained.

The storage cost for a prebuild is therefore calculated as: price per GB * size (GB) * regions * versions.

To limit the storage costs associated with prebuilds, you can choose to create prebuilds only in selected regions, and you can specify the number of older versions of prebuilds that will be retained. For more information, see "Configuring prebuilds."

Note: Prebuilds may be updated several times during a billing month. Newer versions of a prebuild may be larger or smaller than the previous versions. This will affect the storage charges. For details of how storage is calculated during a billing month, see "Billing for storage usage" above.

Cost of codespaces created from prebuilds

Use of codespaces created using prebuilds is charged at the same rate as regular codespaces.

Setting a spending limit

Note: You must set a non-zero spending limit before you can use GitHub Codespaces.

By default, your organization or enterprise will have a GitHub Codespaces spending limit of $0. This prevents new codespaces from being created, or existing codespaces from being opened, if this would incur a billable cost to your organization or enterprise. To allow your users to create codespaces in your organization, set the limit to a value higher than $0.

For information on managing and changing your account's spending limit, see "Managing your spending limit for GitHub Codespaces."

If your organization reaches its spending limit, people will no longer be able to create or resume codespaces that are billable to your organization. However, they can still export any work in progress changes to a new branch.

Limiting the choice of machine types

By default the machine type with the lowest valid resources is used when a codespace is created. However, users may be able to choose a machine type with more resources. They can do this either when they create a codespace, or they can change the machine type of an existing codespace. For more information, see "Creating a codespace"" and "Changing the machine type for your codespace."

If a machine type that has more resources is chosen, this will affect the per-minute charge for that codespace, as shown above.

Organization owners can create a policy to restrict the machine types that are available to users. For more information, see "Restricting access to machine types."

How billing is handled for forked repositories

To incur charges to an organization account (or to an enterprise account, if the organization belongs to an enterprise), the user must be a member or collaborator of that organization, otherwise they cannot create a codespace for which the organization, or its parent enterprise, would be billed.

For example, a user in an organization can fork a repository within that organization, and can subsequently use a codespace billed to the organization. This is because the organization is the owner of the parent repository, and can remove the user's access, the forked repository, and the codespace.

How billing is handled when a repository is transferred to another organization

Usage is calculated every hour. An organization pays for usage of codespaces created from any repository owned by the organization, where the organization settings permit the organization to be billed. For more information, see "Enabling GitHub Codespaces for your organization." When a repository is transferred out of your organization, ownership and billing responsibility for any codespaces associated with that repository will change accordingly.

What happens when users are removed

If a user is removed from an organization or repository, their codespaces are automatically deleted.