How to Set Firebase Spend Caps for AI Logic
Set Firebase spend caps on AI Logic, Cloud Functions, and App Hosting to pause services and avoid surprise bills. Step-by-step Blaze plan guide.
Firebase spend caps act as circuit breakers for specific services. They send alerts at 50% and 80% of your monthly budget, then pause the service at 100%. This helps prevent unexpected charges from AI features or functions during traffic spikes or coding mistakes.
You need a project on the Blaze pricing plan. Spend caps are available for Firebase AI Logic (covering Gemini Developer API or Agent Platform Gemini API), Firebase App Hosting, Cloud Functions for Firebase, and Firebase Extensions. They apply to one project and one service at a time.
Requirements and access
You need admin-level access. Any of these roles work:
- Billing Account Administrator on the linked Cloud Billing account
- Project Owner on the Firebase project
- Billing Account Costs Manager on the billing account plus Project Editor on the project
Confirm your project uses the Blaze plan. Free Spark plan projects cannot set spend caps.
Configure a spend cap in the Firebase console
Open the Firebase console and select your project.
- Go to Settings > Usage and billing > Details & settings.
- Find the Service-level spend caps card.
- Locate the service (for example, Firebase AI Logic).
- Enter a monthly budget amount.
- Click Configure.
The budget covers the full calendar month, starting on the first day. Cloud Billing begins monitoring immediately after you save.
You can also configure spend caps in the Google Cloud console under Billing > Budgets & alerts, with more advanced options.
What happens at each threshold
Cloud Billing monitors spending for the capped service.
- At 50% and 80%: It sends warning emails to billing administrators, project owners, and essential contacts.
- At 100%: It enforces the cap. New usage of that service pauses for the rest of the month. You receive another alert email, and banners appear in the Firebase and Cloud consoles.
Client apps receive errors when calling the paused service. Handle these in code with try-catch blocks or equivalent so users see a graceful message instead of a crash.
Lift an enforced spend cap
If the service pauses and you want to resume it the same month, lift the cap explicitly.
- Return to Settings > Usage and billing > Details & settings.
- Open the Service-level spend caps card.
- Find the enforced service and click Lift.
The state changes to Lifted after a short delay (up to an hour for some services). The service resumes. For the rest of the month it runs without a limit unless you set a higher budget.
To raise the limit after enforcement:
- Lift the cap and wait until the status shows Lifted.
- Edit the budget to a higher amount that exceeds current monthly spend (including any overage from reporting delays).
- Save. The cap returns to Configured under the new amount.
Example: A $10 cap hits $11 with delay overage. After lifting and raising to $20, roughly $9 remains for the month. The next month resets to the original or updated budget automatically.
Important limitations
Spend caps are not hard instantaneous stops. Usage reporting latency means enforcement can lag by several minutes. Any costs during that window are billed normally. Set your cap slightly below the absolute maximum you will accept.
Each cap covers only one project and one eligible service. It does not apply across an entire billing account, folder, or multiple projects. When you cap Firebase AI Logic, the limit covers all ways that service is used in the project (Firebase AI Logic SDK, ADK, Genkit, SQL Connect, and similar).
If you do not lift an enforced cap, the service stays paused only for the current month. It resumes automatically at the start of the next month under the original budget.
Tips for AI and function workloads
Start with a conservative budget for Firebase AI Logic if you are testing Gemini features. Monitor the 50% and 80% emails closely during early traffic.
Combine spend caps with App Check and Security Rules. Caps control cost; those tools control access and abuse.
For projects that also use Firebase in Google AI Studio Android builds, review the shared quota and App Check setup described in our guide on adding Firebase to Android apps in Google AI Studio.
Test error handling in your client code before you rely on a tight cap in production.
Sources
- Firebase documentation: Set up spend caps for Firebase services
- Firebase Blog: Introducing Firebase spend caps
- Firebase YouTube: September 2026 release notes video covering spend caps
Share this story