Unexpected Gemini 2.0 Flash charges appeared in AI
Studio. A single request was billed for 3 million input tokens. All my
requests are very short, and from my past usage, the total token count per
day is usually only in the tens of thousands. However, this single request
consumed 3 million input tokens, which is clearly abnormal.
I reported this issue to Google Cloud Billing, but after two weeks, they replied that it was outside their scope and advised me to report it in the community. So, I’m bringing it here.
Hi @yang_piao,
Welcome to the Google AI Forum!

Please delete all your API keys immediately and create new ones.
Potential Causes:
This is unusual and could be because someone are using your API keys.. Please check if you have shared your API key with someone, or shared code that has hard coded key, or pushed hard coded key to public domains like github..
Remediation Steps:
Establish OAuth to your account
Architectural Patterns to prevent such issues in future
Establish OAuth and frequently refreshing API keys pattern (simple) OR completely avoid access to API key access to project users by using OAuth + Proxy + token + refresh token pattern.
These approaches help you gain user level tracking with authentication and prevents exposing API keys thereby completely avoiding leaks.
I hope this helps resolve your issue.
Hello, I’d like to report a key leakage issue to you. Please check your direct messages.
Hi! Thanks for your quick reply. I missed this message over the past few days.
However, this issue should be unrelated to the key leak, since the 3M token usage request was made from my server, and I have the corresponding record.
The Gemini API reported an input token usage of 3M after a small audio file was uploaded for transcription.
I’d like to add more information here. In this image, it can be seen that the 3M tokens come from the audio input tokens.
Hi, thanks for your reply. As mentioned in my previous message, this request was actually made from my server and should not be related to the key leak issue. I suspect that this might be caused by a Gemini audio processing bug, which resulted in abnormal token usage counting.
You might need to contact the billing team for clarification, or post on X to try and get attention. I wanted to raise a different issue, sorry for taking up your thread