Skip to main content

Managing the spending limit for GitHub Codespaces

You can set a spending limit for GitHub Codespaces usage.

About the GitHub Codespaces spending limit

GitHub Codespaces 由组织、企业或个人帐户支付。 个人帐户的免费版和专业版计划包括免费使用 GitHub Codespaces,每月有最多固定使用量。 See "About billing for GitHub Codespaces."

注意:必须为个人、组织或企业帐户设置非零支出限制,然后才能向帐户对 GitHub Codespaces 的使用进行计费。

默认情况下,所有帐户的 GitHub Codespaces 支出限制为 0 美元。 这可以防止创建新的 codespace 或打开现有 codespace,如果执行这些操作,将对个人、组织或企业帐户产生可计费成本。 对于个人帐户,如果你有权创建 codespace,只要帐户还没有达到其每月包含的使用量限制,就可以执行此操作。 对于组织和企业,默认支出限制意味着,要允许用户创建向组织或其父企业计费的 codespace,必须将限制更改为高于 0 美元的值。 始终按月计算 GitHub Codespaces 的费用,即使你的帐户按年计费也是如此。

Once you've reached your spending limit, you will no longer be able to create new codespaces, and you won't be able to start existing codespaces. Any existing codespaces that are still running will be shut down in a short time, but you will not be charged for usage after you have reached your spending limit.

Using your Azure Subscription

If you are an organization owner, you can connect an Azure Subscription ID to your organization account to enable and pay for GitHub Codespaces usage. See "连接 Azure 订阅."

Managing the GitHub Codespaces spending limit for your personal account

You can set a spending limit for GitHub Codespaces for your own personal account.

  1. 在 GitHub 任意页的右上角,单击个人资料照片,然后单击“设置”。

  2. 在侧边栏的“访问”部分,单击“ 计费和计划”,然后单击“支出限制” 。

  3. 在页面顶部的“付款信息”下,单击“管理支出限制”。

    “账单设置”页的“摘要”部分的屏幕截图。 右侧以深橙色边框突出显示了“管理支出限制”。

  4. 在“Codespaces”下,选择“限制支出”并输入支出限制,或选择“无限制支出”。

  5. 根据选择的选项,单击“更新限制”或“更新为无限制”。

Managing the GitHub Codespaces spending limit for your organization account

Organizations owners and billing managers can manage the spending limit for GitHub Codespaces for an organization.

Note: Organizations that are owned by an enterprise account cannot specify their own spending limit as this is specified in the enterprise settings.

  1. 在 GitHub 任意页的右上角,单击个人资料照片,然后单击“设置”。

  2. 在边栏的“访问”部分中,单击“ 组织”。

  3. 在组织旁边,单击“设置”。

  4. 如果你是组织所有者,请在侧边栏的“访问”部分,单击“ 计费和计划”。

  5. 在页面顶部的“付款信息”下,单击“管理支出限制”。

    “账单设置”页的“摘要”部分的屏幕截图。 右侧以深橙色边框突出显示了“管理支出限制”。

  6. 在“Codespaces”下,选择“限制支出”并输入支出限制,或选择“无限制支出”。

  7. 根据选择的选项,单击“更新限制”或“更新为无限制”。

Exporting changes when you have reached your spending limit

如果个人、组织或企业帐户达到其支出限制,则无法再创建或恢复可向该帐户计费的 codespace。 但你仍然可以将任何正在进行的更改导出到新分支。 有关详细信息,请参阅“将更改导出到分支”。

Managing usage and spending limit email notifications

Email notifications are sent to account owners and billing managers when spending reaches 75%, 90%, and 100% of an account's spending limit.

You can turn off these notifications at any time from the "Billing and plans" page. To turn off notifications, under "Email alerts", deselect the Spending limits alerts checkbox.

For personal accounts only, you can also choose to turn off email notifications that are sent when you have used 75%, 90%, and 100% of the free usage included with your personal account. To do this, clear the Included resources alerts checkbox.

Screenshot of the "Email alerts" settings. The options "Included resources alerts" and "Spending limit alerts" are both selected.

Further reading