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.