I want to deploy my poc app. I like a project level settings that will stop gemini api usage once it hits say $30 and not code level like counting tokens or api call.
Any good documentation you can refer me to? I don’t see any about it on ai studio unlike openAI where I can set a budget for a project.
Absolutely absurd, this. Is this still the case even now in March 2025? Literally in disbelief that it seemingly doesn’t exist. How would anyone use Gemini API in their apps etc without this basic protective feature that all rivals have?
Create a Cloud Pub/Sub topic to receive notifications when the Budget is hit
Connect the Budget to the Cloud Pub/Sub Topic
Create a Cloud Run Function that is triggerred when a message is sent to the Pub/Sub Topic (that is, when the Budget is reached) that will disable billing on the project (code is provided in the docs)
Configure IAM to give the Service Account associated with the Cloud Run Function to disable billing for the project
Thank you. Okay…so…I had Claude set something like this up for me a few days ago, but realised 2-3 days later that it had been charging me around $1 a day! Is this method cost-free?
This is SO INSANE that this extremely basic feature is not implemented. Just make a check in the code and throw an error if you are above the limit. Every LLM provider has this.
Makes it very hard to choose Gemini as my LLM provider.
Ooof. Big miss, in my opinion. As a dabbler in AI, building AI-powered products by myself in my spare time, I really NEED to ensure I don’t go over budget. With Anthropic and OpenAI I manually top off my account as needed. But if I trigger a call and it ends up burning through $100 without me even knowing it, that would really hurt.
Yes I see that there is a way to set it up manually, but it’s pretty ridiculous that I’d have to do that and it’s probably enough to keep me away.
Also just made an account on this forum to state that this is madness to not be able to restrict the monthly spent for the Gemini API key(and Google Cloud as well), just think of what can happen in a single day if that key or account gets stolen…
I was trying to decide if I will use Gemini models in my project instead of competitors, but I just realized that you can quickly bankrupt your business if someone stoles your key or account as you don’t really have a way to stop it in time, even if you do the “workaround” with the notification sent to a Pub/Sub that will then trigger a cloud function, that will eventually disable the billing account, because the notifications most likely will not be triggered in time (they say delays can take ~24h) and when you disable the billing it will remove all resources and configurations from the project, thus the need to recreate all again. Plus, just setting up the workaround is a pain and prone to errors (just think about the notification not being able to be sent to the Pub/Sub or be able to trigger the Cloud function in time, etc), Who is to blame?
Really hope that someone from Google realizes that this is a recipe for disaster for small businesses and individuals. I know that Google needs more people to spend as much as possible on Google Cloud, but they should also consider that it can really destroy businesses(make an error and push the API key on a public repository… Plus, I really don’t understand how nobody got in a lawsuit with Google, based on this basic budget restriction option that can create so much damage, yet is not implemented after years of being online(Google Cloud platform).
$30 is too much for what g00gle offers.
There is only on what g00gle model offer lately.
I was a BIG FAN of them, but last week was too much for me. Too many bugs and hallucination saved automatically.
$30 is too much for what g00gle offers.
BYE g00gle!
What is the expected latency between the budget being “hit” (Real API call cost exceeds budget) and the reporting/notification triggering? In the event of a compromised key will it be seconds/minutes/hours before it is automatically stopped?
I really need a simple and effective way to set a spending limit. AI is still very new and most of the projects I work on are experimental, so I need this security measure to ensure they don’t go over budget. I won’t be able to use Gemini for production until a feature like this is implemented.
This is a simple feature, and Google is forcing us to have a nightmare with this service. I love Google environments, but all cloud providers have a budget limit API. I’m moving my product to OpenRouter where I can set up an API budget.