Skip to main content

Gestion de la limite de dépense pour GitHub Codespaces

Vous pouvez définir une limite de dépense pour l’utilisation de GitHub Codespaces.

Note

Enterprise accounts, and organizations owned by enterprise accounts, created after June 2, 2024, have access to the enhanced billing platform. Enterprises that participated in the public preview program also have access to the enhanced billing platform.

The enhanced billing platform offers better spending control and detailed visibility to help you understand your usage with more granular controls. See "Using the new billing platform."

About the GitHub Codespaces spending limit

GitHub Codespaces is paid for either by an organization, an enterprise, or a personal account. The Free and Pro plans for personal accounts include free use of GitHub Codespaces up to a fixed amount of usage every month. See About billing for GitHub Codespaces.

Note

You must set a non-zero spending limit on your personal, organization, or enterprise account before the account can be billed for use of GitHub Codespaces.

By default, all accounts have a GitHub Codespaces spending limit of $0 USD. This prevents new codespaces being created, or existing codespaces being opened, if doing so would incur a billable cost to your personal, organization, or enterprise account. For personal accounts, if you have access to create a codespace, you can do so as long as the account has not reached the limit of its monthly included usage. For organizations and enterprises, the default spending limit means that, to allow people to create codespaces that are billed to the organization, or its parent enterprise, the limit must be changed to a value above $0 USD. Costs for GitHub Codespaces are always billed monthly, even if your account is otherwise billed annually.

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 or enterprise owner, you can connect an Azure Subscription ID to your organization or enterprise account to enable and pay for GitHub Codespaces usage. See Connecting an Azure subscription.

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. In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.

  2. In the "Access" section of the sidebar, click Billing and plans, then click Spending limits.

  3. At the top of the page, under "Payment information," click Manage spending limit.

    Screenshot of the summary section of the billing settings page. On the right, "Manage spending limit" is highlighted with a dark orange outline.

  4. Under "Codespaces", either select Limit spending and enter a spending limit, or select Unlimited spending.

  5. Depending on which option you chose, click either Update limit or Update to unlimited.

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. In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.

  2. In the "Access" section of the sidebar, click Organizations.

  3. Next to the organization, click Settings.

  4. If you are an organization owner, in the "Access" section of the sidebar, click Billing and plans.

  5. At the top of the page, under "Payment information," click Manage spending limit.

    Screenshot of the summary section of the billing settings page. On the right, "Manage spending limit" is highlighted with a dark orange outline.

  6. Under "Codespaces", either select Limit spending and enter a spending limit, or select Unlimited spending.

  7. Depending on which option you chose, click either Update limit or Update to unlimited.

Managing the GitHub Codespaces spending limit for your enterprise account

Enterprise owners and billing managers can manage the spending limit for GitHub Codespaces for an enterprise account.

  1. In the top-right corner of GitHub, click your profile photo.

  2. Depending on your environment, click Your enterprise, or click Your enterprises then click the enterprise you want to view.

  3. On the left side of the page, in the enterprise account sidebar, click Settings.

  4. Under Settings, click Billing.

  5. On the "Billing" page, click the Spending limit tab.

    Screenshot of the "Billing" page. A tab labeled "Spending limit" is highlighted with an orange outline.

  6. Under "Codespaces", either select Limit spending and enter a spending limit, or select Unlimited spending.

  7. Depending on which option you chose, click either Update limit or Update to unlimited.

Exporting changes when you have reached your spending limit

If your personal, organization, or enterprise account reaches its spending limit, you will no longer be able to create or resume codespaces that are billable to that account. However, you can still export any work-in-progress changes to a new branch. For more information, see "Exporting changes to a branch."

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