CostHex

How to set a GCP budget cap

GCP spend caps pause new usage for one eligible service in one project. Overages remain possible. Account-wide budgets send alerts and leave services running. Set a service cap below, then add alerts for other costs.

Set a service spend cap

Google's eligible-service list covers Gemini API, Gemini Enterprise Agent Platform (formerly Vertex AI), Cloud Run and Cloud Run functions. Each cap covers one project and one service, using gross estimated costs before savings and credits.

  1. Open Billing → Budgets & alerts → Create new budget.
  2. Select Spend cap enforcement, name the budget, then choose one project and eligible service.
  3. Enter a monthly target below your loss tolerance. Select Next → Finish.

A Billing Account Administrator can configure caps; Google also documents project-scoped permissions. Enforcement is delayed, overages remain billable, and ongoing fixed compute or storage charges can continue.

To resume, edit the enforced budget and select Lift spend cap → Confirm. It stays lifted for that month unless you raise the cap. Normal service can take up to one hour to return. Caps reset next month.

Add a budget alert for the rest of your bill

An alerts-only budget can cover a billing account, selected projects or services. It sends notifications without pausing usage.

  1. In Budgets & alerts, create another budget and choose Alerts only.
  2. Name it, then select its period and scope. With billing-account access, select all scope filters to watch the whole account.
  3. Set your amount and actual-spend or forecast thresholds. Check email recipients, then select Finish.

Billing Account Costs Manager or Administrator roles can create account budgets. Project-scoped access covers authorized projects. The first notification can take hours, and usage reporting is delayed. Set alerts below your available funds.

For an automated response, connect Pub/Sub

Programmatic budget notifications can feed Slack or a response function. Create a Pub/Sub topic, connect it to the budget, and implement a subscriber that checks the budget message before taking action. This requires budget and Pub/Sub permissions.

Choose the response before deploying it. For a development project, downtime may be acceptable. For production, write down which resources to stop, which to retain, and who can restore service. Test with a disposable project and confirm that the notification reaches the intended recipient.

Should you disable project billing at the threshold?

Google provides a billing-disable automation tutorial. This shuts down all Google Cloud services in that project, including Free Tier services. Resources can be irretrievably deleted; re-enabling billing does not guarantee recovery. Reporting delays can still cause a bill above your budget.

Use that approach only after deciding you can lose the project's services and resources. A cap on one eligible service has a different scope from shutting down an entire project.

For Firebase-specific controls, read the Firebase budget-cap guide. The Firebase and Cloud Run bill account shows why a recursive workload needs a clear stopping condition as well as a budget.

Official sources