Sudden increasee of api, using gemini


As a Student creating a thesis, using Gemini is good thing in terms of making an AI based website. But the problem is that the spike of cost we need to pay is not reasonable, everything in our billing is gemini api causing our database also terminated because we don’t have that money to pay for that. Hope this resolves the issue.

Hi @rrazelkim,

Welcome to the Forum,

Thank you for reaching out. I’m sorry to hear about the unexpected costs you’ve encountered. For any issues related to billing, unexpected charges or payments the Cloud Billing support team is the best group to assist you. You can contact them directly here: Get Cloud Billing support  |  Support Documentation  |  Google Cloud

I hope they can help you find a swift resolution

1 Like

Hello, I already send a message according to this. Can I ask also for your help? Would be really glad to help us. Thankyouu so much

Hi @rrazelkim,

Delete all your API key immediately and create a new ones.
Please check your applications usage.. If it doesn’t align with your usage, it is most likely that your API key is leaked and being abused by others.. Do establish alerts in your GCP console to make you aware of such instances

Please check think of all possible situations during which you might have shared API key online:

  • Pushed to public repos like github
  • Shared colab notebook online
  • Shared with a friend
  • Uploaded a project, etc

There has been few instances where hackers are using bots to scrape publicly available API keys and abusing them.. Please be careful.

Thankyou so much for the concern, I know all the possibilities but the AI is disable when we are not using it, we remove all the keys and disable in cloud. So we really don’t know why that happened. Thankyou so much also I already delete and shutdown the project after that happen so bill will not increase.

You can’t disable an API key unless you delete it @rrazelkim..

The best way to remediate such instances is to use as “Secrets” if you are using in Colab notebooks..

For applications, make sure to have OAuth setup which adds an additional authentication layer.

Do follow these practices to avoid such instances in future.

Happy AI’ing :slight_smile:

Thankyou for the info, I’m just a student still learning all of these ideas is helpful for me. But after that incident I already delete the API and shutdown the project so that the bill will not spike more since August the creator of gemini also tweeted in X about sudden spike of billings, also same in other developers.