Skip to main content

Managing billing for GitHub Codespaces in your organization

You can check your GitHub Codespaces usage and set usage limits.

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 的产品”。

Overview

To learn about pricing for GitHub Codespaces, see "About billing for GitHub Codespaces."

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

计算计算使用情况

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

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

计算存储使用情况

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

  • As an organization owner or a billing manager, you can manage GitHub Codespaces billing for your organization: "About billing for Codespaces"
  • As an organization owner, you can list the currently active and stopped codespaces for your organization. In addition to these codespaces, costs for the current month may include costs for codespaces that existed earlier in the current month but have since been deleted.
  • For users, there is a guide that explains how billing works: "Understanding billing for GitHub Codespaces"

Usage limits

You can set a usage limit for the codespaces in your organization or repository. This limit is applied to the compute and storage usage for GitHub Codespaces:

  • Compute minutes: Compute usage is calculated by the actual number of minutes used by all GitHub Codespaces instances while they are active. These totals are reported to the billing service daily, and is billed monthly. You can set a spending limit for GitHub Codespaces usage in your organization. For more information, see "Managing spending limits for GitHub Codespaces."

  • Storage usage: For GitHub Codespaces billing purposes, this includes all storage used by all codespaces in your account. This includes resources such as cloned repositories, configuration files, and extensions, among others. These totals are reported to the billing service daily, and is billed monthly. At the end of the month, GitHub rounds your storage to the nearest MB. To check how many compute minutes and storage GB have been used by GitHub Codespaces, see "Viewing your GitHub Codespaces usage"."

Disabling or limiting Codespaces

You can disable all use of GitHub Codespaces that would be billed to your organization. Alternatively, you can specify which organization members or collaborators can use Codespaces at your organization's expense. For more information, see "Enabling GitHub Codespaces for your organization."

注意:如果为组织禁用计费 codespace 使用,则可以作为个人用户创建 codespace,并且可以克隆组织中的存储库的任何人都可以为该存储库创建 codespace。 但是,这不会对组织产生任何费用。 有关限制存储库访问的信息,请参阅“管理有权访问存储库的团队和人员”。

You can configure which repositories can be accessed from codespaces created for a particular repository. For more information, see "Managing access to other repositories within your codespace."

You can limit the choice of types of machine that are available for codespaces created from repositories owned by your organization. This allows you to prevent people using overly resourced machines for their codespaces, and incurring unnecessary charges. For more information, see "Restricting access to machine types."

You can also restrict how long a codespace can remain unused before it is automatically deleted. This can help to reduce storage costs for Codespaces. For more information, see "Restricting the retention period for codespaces."

Deleting unused codespaces

Your users can delete their own codespaces in https://github.com/codespaces and from within Visual Studio Code. To reduce the size of a codespace, users can manually delete files using the terminal or from within VS Code.

As an organization owner, you can delete any codespace in your organization. For more information, see "Deleting a codespace."

Note: Codespaces are automatically deleted after they have been stopped and have remained inactive for a defined number of days. For more information, see "Restricting the retention period for codespaces." A codespace can only be manually deleted by the person who created the codespace.

Further reading