Can you pre-load money into your account and have that be used until it's zero, at which time you have to load more? Deepseek does it this way.
€54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
71–80 of 325 posts
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#72Can you pre-load money into your account and have that be used until it's zero, at which time you have to load more? Deepseek does it this way.
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#73Earlier quoted context omitted.
You can also have both, a cap and one or more billing alert levels below it. Some providers do this (e.g. IIRC Backblaze B2).
Yes in reality, and ideally, you can have both, but GP specifically said "Prepaid only" implying you can't have both (which is what I replied to)
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#74Earlier quoted context omitted.
Not if its publicly called from Javascript, as your user's browser will make those requests. You neither know their IP addresses, nor is the referer or origin header a safe choice as it can be spoofed outside of a browser.
If it's called from Javascript in the browser, it's not a secret API key....
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#75As long as they revert the charge when notified of scenarios like this , and they have historically done so for many cases, it's fine. It's an acceptable workaround for a hard problem and the cost of doing business ( just like Credit Cards accept a certain amount of loss to fraud as part of business)
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#76> We had a budget alert (€80) and a cost anomaly alert, both of which triggered with a delay of a few hours. By the time we reacted, costs were already around €28,000. I had a similar experience with GCP where I set a budget of $100 and was only emailed 5 hours after exceeding the budget by which time I was well over it. It's mind boggling that features like this aren't prioritized. Sure it would probably make Google…
Exactly my thoughts, can not really understand how delayed alerts are acceptable... Have you managed to settle the cost with Google, what was the outcome?
Google support was surprisingly understanding, after I explained the issue. They asked some clarifying questions. Then they said that they can offer a one time refund for this case.
Since then I was paranoid not to accidentally do it again. I don't know whether GCP would refund a second time.
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#77Leading tech companies in 2026, folks.
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#78Considering the amount of repositories on public GitHub with hard-coded Gemini API tokens inside the shared source code ( https://github.com/search?q=gemini+%22AIza%22&type=code ), this hardly comes as a surprise. Google also has historically treated API keys as non-secrets, except with the introduction of the keys for LLM inference, then users are supposed to treat those secretly, but I'm not sure everyone got that…
This was reported a long time ago, and was supposed to be fixed by Google via making sure that these legacy public keys would not be usable for Gemini or AI. https://news.ycombinator.com/item?id=47156925 https://ai.google.dev/gemini-api/docs/troubleshooting#google... "We are defaulting to blocking API keys that are leaked and used with the Gemini API, helping prevent abuse of cost and your application data." Why are we hearing about this again?
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#79As others have said, this is a "feature" for Google, not a bug. There is no easy way to set a hard cap on billing on a project. I spent the better time of an hour trying to find it in the billing settings in GCP, only to land on reddit and figuring out that you could set a budget alert to trigger a Pub/Sub message, which triggers a Cloud Function to disable billing for the project. Insanity.
This is a sign that somehow there isn’t sufficient incentive to work on these features.
Re: €54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs
#80I read the following [0] and immediately went to my firebase project to downgrade my plan. This is horrific. > Yes, I’m looking at a bill of $6,909 for calls to GenerativeLanguage.GenerateContent over about a month, none of which I made. I had quickly created an API key during a live Google training session. I never shared it with anyone and it’s not pushed to any public (or private) repo or website. 0 - https://disc…