Firebase浏览器密钥无限制访问Gemini API导致13小时内飙升5.4万欧元。
€54k spike in 13h from unrestricted Firebase browser key accessing Gemini APIs

原始链接: https://discuss.ai.google.dev/t/unexpected-54k-billing-spike-in-13-hours-firebase-browser-key-without-api-restrictions-used-for-gemini-requests/140262

一位开发者在现有Firebase项目中启用Firebase AI Logic(使用Gemini API)后不久,Google Cloud账单上出现了一笔超过54,000欧元的巨额且意外的费用。API使用量在数小时内激增,与合法用户活动无关,且呈现自动化特征,只有在禁用API并轮换凭据后才停止。 尽管触发了成本警报(但有延迟),由于报告滞后,损失仍然巨大。Google Cloud支持认为该使用量“有效”,因为它来自他们的项目,拒绝了账单调整。开发者强调,最近出现了一种转变,即Google API密钥不再被视为非机密信息,详情请参见Truffle Security的一篇文章。 他们正在向社区寻求建议:是否有人遇到过类似Firebase AI Logic/Gemini的问题?除了App Check、配额和服务器端调用之外,还推荐哪些额外的安全措施?对于像这样异常的账单争议,还有哪些进一步的升级途径?

最近Hacker News报道称,谷歌Gemini AI API的使用量出现显著激增——13小时内高达54,000欧元,原因是Firebase浏览器密钥存在未限制访问的问题。用户对谷歌的系统未能检测并限制这种异常活动感到震惊,尤其考虑到该公司在机器学习方面的专业知识。 讨论强调了谷歌云平台(GCP)的一个关键缺陷:缺乏消费限制。虽然有通知可用,但用户可能会产生巨额且意外的账单。一些人建议用实时加密支付取代API密钥,但另一些人担心这会给开发者增加不必要的摩擦。这起事件凸显了谷歌AI服务中需要更好的计费控制和异常检测。
相关文章

原文

Hello,

We are looking for guidance regarding an unexpected €54,000+ Gemini API charge that occurred within a few hours after enabling Firebase AI Logic on an existing Firebase project.

Background:

We created the project over a year ago and initially used it only for Firebase Authentication. Recently, we added a simple AI feature (generating a web snippet from a text prompt) and enabled Firebase AI Logic.

What happened:

Shortly after enabling this, we experienced a sudden and extreme spike in Gemini API usage. The traffic was not correlated with our actual users and appeared to be automated. The activity occurred within a short overnight window and stopped once we disabled the API and rotated credentials.

Additional observations:

  • 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
  • The final amount settled at €54,000+ due to delayed cost reporting

This describes our issue in more detail:

Aftermath:

We worked with Google Cloud support and provided logs and analysis. The charges were classified as valid usage because they originated from our project, and our request for a billing adjustment was ultimately denied.

This usage was clearly anomalous, not user-driven, and does not reflect intended or meaningful consumption of the service.

Questions:

  • Has anyone encountered a similar issue after enabling Firebase AI Logic or Gemini?
  • Are there recommended safeguards beyond App Check, quotas, and moving calls server-side?
  • Is there any escalation path we may have missed for cases like this?

Any guidance or shared experience would be greatly appreciated.

3 Likes

联系我们 contact @ memedata.com