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 可用于使用 GitHub Team 或 GitHub Enterprise Cloud 的组织。 GitHub Codespaces 也可作为受限的 beta 版本提供给使用 GitHub Free 和 GitHub Pro 计划的个人用户。 有关详细信息,请参阅“GitHub 的产品”。

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. Repositories in personal accounts are not currently billed for GitHub Codespaces usage.

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

ProductSKUUnit 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

About billing for GitHub Codespaces

Codespaces 根据其计算和存储使用情况按美元计费。


计算使用情况定义为 GitHub Codespaces 实例处于活动状态的运行时间总分钟数。 计算使用情况通过将所有 codespace 使用的实际分钟数相加来计算。 这些总数每天报告给计费服务,并按月计费。

运行时间通过停止 codespace 进行控制,可在开发人员指定的非活动期之后手动或自动完成。 有关详细信息,请参阅关闭或停止 codespace


出于 GitHub Codespaces 计费目的,这包括你帐户中所有 codespace 使用的所有存储空间。 这包括 codespace 使用的所有文件,例如克隆的存储库、配置文件和扩展等。 这些总数每天报告给计费服务,并按月计费。 到月底,GitHub 会将您的存储量舍入到最接近的 MB。

Your GitHub Codespaces usage shares your organization or enterprise account's existing billing date, payment method, and receipt. 要查看帐户在 上的所有订阅,请参阅“查看订阅和计费日期”。

若要估算消耗性服务的成本,可以使用 GitHub 定价计算器

Billing for Codespaces prebuilds

默认情况下,每次创建或更新预生成或推送到启用预生成的分支时,都会触发 GitHub Actions 工作流。 与其他工作流一样,虽然预生成工作流正在运行,但它们会消耗帐户中包含的一些 Actions 分钟数(如果有),或者它们会产生 Actions 分钟费用。 有关 Actions 分钟定价的详细信息,请参阅“关于 GitHub Actions 的计费”。

除了 GitHub Actions 分钟数,还将针对与给定存储库和区域的每个预生成配置关联的预生成的存储计费。 预生成的存储按与 codespace 存储相同的费率计费。

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 template versions to be retained for your prebuild configurations. 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 GitHub Actions 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."

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."

如果达到支出限制,你将无法再创建或恢复 codespace。 你仍然可以将任何正在进行的更改导出到新分支

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, which can remove the user's access, the forked repository, and the codespace.

How billing is handled when a repository is transferred

Usage is billed and reported on every hour. As such, you pay for any usage when a repository is within your organization. When a repository is transferred out of your organization, any codespaces in that repository are removed as part of the transfer process.

What happens when users are removed

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