CostHex

How to set a Firebase budget cap

On Blaze, Firebase offers spend caps for selected services. Each cap covers one service in one project, and delayed enforcement can allow overages. Set a service cap where available, then add budget alerts for the rest of your bill.

Check which Firebase services have caps

Firebase spend caps are in Preview. Eligible products are Firebase AI Logic, App Hosting, Cloud Functions for Firebase and Extensions. Firestore is absent from that list; use billing alerts for its costs.

Caps apply to the underlying service across the project. Set separate caps for separate eligible services. A Functions cap does not cap your entire Firebase bill.

Configure a monthly spend cap

  1. Open your project in the Firebase console. Go to Settings → Usage and billing → Details & settings.
  2. Find Service-level spend caps.
  3. Choose an eligible service, enter its monthly budget and select Configure.

Use a project Owner or the required billing permissions listed in Firebase's documentation. At the threshold, new usage pauses for the month. Set the amount below your absolute tolerance for loss because overages remain billable.

Add alerts for your whole project

Alerts-only budgets send email when costs cross thresholds. They leave services running, including when spending exceeds the budget.

  1. In Usage and billing → Details & settings, find Budget alerts and select Create first budget. An existing budget appears here if one is already configured.
  2. In Cloud Billing's Budgets & alerts, create or select a budget. Name it and choose the project and service scope. Select All services to watch the whole project.
  3. Enter the budget amount, choose actual-spend or forecast thresholds, and check who receives emails before saving.

Firebase's setup guide uses a Billing Account Administrator on the linked account. Send alerts to someone who can investigate and stop unwanted usage. Budget email is not an immediate circuit breaker.

Understand what can still cost money

Cloud Billing's cap rules use gross estimated costs, excluding savings and credits. In-flight requests can finish and incur charges. Persistent resources can keep accruing fixed compute or storage charges after new usage is paused.

After investigating a pause, use Lift to resume the service. Lifting leaves it uncapped for the rest of the month unless you configure a higher cap. Set that amount above this month's accrued costs or it can pause again. The cap resets at the next monthly period; resuming service can take up to one hour.

Before relying on a cap, decide whether your app can tolerate errors from a paused service. Record who will restore it and review related services that the cap does not cover.

For a sourced example of runaway usage, read the Firebase and Cloud Run bill account. For Workers, use the separate Cloudflare spending controls guide.

Official sources