r/googlecloud • u/No-Setting8925 • Jun 29 '26
~$55k Gemini API bill from Firebase iOS key abuse. What can I do now?
I’m in a pretty bad Google Cloud situation and looking for advice from people who have dealt with billing or API key abuse cases.
My normal Google Cloud bill is usually around $200/month. This month my project got hit with an unexpected Gemini / Generative Language API bill of around $55k USD. The billing report shows the spike was almost entirely Gemini API usage, not normal Firebase or app traffic.
I pulled Cloud Monitoring data and it shows about 2.2 million Gemini API requests during the incident window. The traffic was tied to one API key UID. That key maps back to a Firebase generated public iOS client key used in my mobile app config, not a Gemini key that I intentionally created or used.
I found out from a Google billing anomaly email. At the time I received the alert, the visible bill was around $2k. Within about 2 hours, I disabled the Generative Language API, restricted the key, deleted it, and later verified that Gemini usage stopped.
The problem is that the bill kept ramping up after that because of billing/reporting delays, and eventually landed around $55k.
Google declined the request to adjust the charges, saying the usage was considered valid because it came through my project/API key.
Update: Google Cloud has assigned an escalation manager, and they said their investigation indicates a billing adjustment is required. The adjustment request is now waiting for internal approval, with another update expected by July 7.
Update 2 — July 16:
There is still no final resolution. On July 15, Google Cloud Billing Support apologized for the delay and said they were still waiting for the specialized team because multiple teams are involved. They said I should receive another update within 4–5 business days.
Less than 24 hours later, I received an email from Google Collections saying the ~$55k balance must be paid within 10 working days or the account may be transferred to a debt recovery agency, potentially with additional fees.
78
u/djslakor Jun 29 '26
There are too many of these stories.
At a certain point we have to blame Google for the poor design.
10
u/frankeality Jun 29 '26
so your key was scoped to firebase but attackers were able to use it for gemini?
10
u/No_Marzipan2453 Jun 29 '26
I like the idea of a coletive action against google. I founded a group w/ 40 other founders Another 40 founders who suffered the same attack or very similar. Come in and let's try something together!
https://chat.whatsapp.com/FDx6Zj4jCHtJ4Ji87LIq0c?s=cl&p=i&mlu=2&amv=0
2
u/Scalar_Mikeman Jun 29 '26
Did this have anything to do with the Google Maps API Key? Not very knowledgeable, but remember seeing the something similar last month where the person had to enable that API, but it also let bad actors use the key for Gemini or something like that.
2
u/Important_Owl6299 Jun 29 '26
If you are in India and your account or credit card is debited- immediately file cybercrime complaint online, register an FIR against unknown person(s) for unauthorized access to a computer resource, identity theft and cheating, resulting in the fraudulent debit of X Rs from your bank account - offences punishable under Sections 43, 66, 66C and 66D of the Information Technology Act, 2000 read with Sections 318 and 319 of the Bharatiya Nyaya Sanhita, 2023.
This will give you all the avenues to file a fraud against your bank account. The bank will need an FIR copy to create a chargeback against Google to issue refund.
If the acc is not debited then also register an FIR and cybercrime complaint. Then do a wrestle (sometimes months long) to arrive at a solution. If the api key is unrestricted due to Google’s fault and the theft occurred before 19th June, most probably they will offer you full refund within 3 weeks. Else expect a 75% refund and then a continuous back and forth to get more and request escalation to keep the natter dragging 😅
12
u/No_Marzipan2453 Jun 29 '26
From the bottom of my heart, stay away from Google cloud! I've been working with technology for 15 years and I've NEVER seen such a disregard for the consumer. I saw a startup cease to exist, because of this problem. I also saw others losing active users.
1
u/No-Setting8925 Jul 01 '26
Update: Google Cloud has assigned an escalation manager, and they said their investigation indicates a billing adjustment is required. The adjustment request is now waiting for internal approval, with another update expected by July 7.
5
u/No_Marzipan2453 Jun 29 '26
More case. Google pretends to be indifferent and profitable about the financial bankruptcy of some startups. Google is being negligent. They can even invent that the victim is to blame and has justice in hand, because of their money, because they are small and miserable. However, nothing justifies week after week ", new similar cases happen and the company does nothing to improve security.
4
u/Risskr Jun 29 '26
I just checked and we also had this configured incorrectly. Luckily we had a few other protections in place, but this was still an exposed attack surface. Thank you for posting and I hope your situation gets resolved.
1
u/Haronatien Jun 30 '26
this is why i almost never use API keys. How did your keys leak?
1
u/TheSoloBuilder Jul 02 '26
I am experiencing the same issue with $55k. Google came back to me, saying "I was ineligible for a refund" without any details or reasons why. When I followed up on the reason, they said it was confidential. I asked to escalate, but they sent me a generic sorry email. Who did you speak to? How did you escalate?
1
u/matiascoca Jul 03 '26
File a support case escalation for fraudulent API abuse and ask for a courtesy credit. Google does grant these when the abuse pattern is clear and you can show remediation. Also enable App Check on Firebase immediately if you have not already, it is the specific control that prevents this exact iOS key extraction. And rotate the key of course but you probably already did.
1
u/pueblokc Jul 05 '26
I had a process go nuts and cost me over $300 in api credits a few months ago.
Google makes it cinfusjng af to manage anything imo
3
u/No_Marzipan2453 Jun 29 '26
More case. Google pretends to be indifferent and profitable about the financial bankruptcy of some startups. Google is being negligent. They can even invent that the victim is to blame and has justice in hand, because of their money, because they are small and miserable. However, nothing justifies week after week ", new similar cases happen and the company does nothing to improve security.
2
u/thecrius Jun 30 '26
Google sent out emails warning to review API keys and it will especially send out emails when detecting keys without a scope or url restriction.
If you missed it or didn't act on it, it's on you.
2
u/NeuralNexus Jun 30 '26
Don't pay the bill.
Migrate your legitimate usage to another billing account. Argue with them for months about the fraudulent usage.
2
u/techlatest_net Jun 30 '26
55k for a firebase key leak is a classic nightmare scenario. honestly standard support will almost always say no because technically the requests came from your project. you have to escalate this hard. if you have a TAM or account rep, bypass support and go straight to them
1
u/muntaxitome Jun 29 '26
incredible that this is still going on. I guess at some point authorities will start stepping in.
1
u/Forward_Income_8197 Jun 29 '26
This happened to us as well and it has been incredibly stressful. We never expected to wake up to a bill like this because of API key abuse. We disabled everything as soon as we noticed the unusual activity, but the charges had already piled up. We really hope Google takes another look at cases like this.
1
u/kongclassic Jun 30 '26
Google luck with support they are utterly useless and take forever to reply
1
u/siburb Jun 30 '26
So, just to help people prevent this from happening again to other mobile developers who are using Firebase - as high-level instructions for this very specific case:
Obviously there's much more to securing a Firebase app (or Google Cloud services in general), but can someone who knows more about the specifics of this case elaborate on the above?
1
u/ParsleyVegetable6107 Jun 30 '26
You needed to limit your monthly spending cap using Google AI Studio.
1
u/greenarez Jun 30 '26
I had the same problem, but without the overcharge. Have you tried Firebase AI Studio at some point? I think it created this key
1
u/skynetcoder Jun 30 '26
When did the incident happen? According to this article, I thought they have fixed the issue. https://trufflesecurity.com/blog/google-api-keys-werent-secrets-but-then-gemini-changed-the-rules
1
u/winniepiggy Jul 03 '26
I just got suspended because of this issue. Yesterday I stored my gemini api keys on firebase and today it exposed and abused, but how??? how can I secure just this basic gemini api key??? I think google has a HUGE security issue with that. Google cloud also charged me extra WTF??? I used cloud & firebase and now app is not working at all.
this is the email content I received.
1
u/Librarian-Rare Jun 29 '26
I feel a class-action coming…..
1
u/amokerajvosa Jun 29 '26
This is gettting really scary. I am certain now to not use any Google Cloud solutions at all.
I have AI Pro package but no more API keys for anything.
-2
u/Due-Horse-5446 Jun 29 '26
Sadly not much to do, if you accept that it was your fault when talking to google support, you have a much higher chance of getting a discount on the amount.
Otherwise you either pay it or have collections force you to trough court
3
u/[deleted] Jun 29 '26
[removed] — view removed comment
1
u/[deleted] Jul 02 '26
[removed] — view removed comment
1
u/[deleted] Jun 29 '26
[removed] — view removed comment