While building an app, i forgot and pushed the env file. After a while, i’ve started getting this message : “Your API key was reported as leaked. Please use another API key”. I delete the repo and the api key, and created a new one but still the same problem. Also, i’ve noticed that the api works in colab but not locally, so i used the mobile phone wifi, but still the same problem. Is there any suggestion please ?
yes getting the same issue, Idk where is leaked bcz i have never shared to anyone and pushed to github. I just rotated the key.
Hii @oscar_romeo
Welcome to the Google AI Forum!!!
Thank you for reaching out.
It looks like your API key was accidentally exposed, which can cause the “key reported as leaked” message.
Please try the following:
- Generate a new API key from your account dashboard.
- Update your environment variables or
.envfile to use this new key only. - Make sure the old key is completely removed from your project, local machine, and any version control.
If the problem continues, you may need to create a new account to generate a fresh API key.
Hi i am getting this error with gemini-embedding-001 model….. ERROR] Gemini embed_content failed: 403 PERMISSION_DENIED. {‘error’: {‘code’: 403, ‘message’: ‘Your API key was reported as leaked. Please use another API key.’, ‘status’: ‘PERMISSION_DENIED’}}, , whenever i generate a new key it works fine for sometime, but after sometime i get this error tho my same key works fine with other models, can you please help?
If you can share an example with steps to reproduce the issue, it helps us to reproduce and showcase to the appropriate teams.
Thanks
It can take a little while for Google’s system to fully reset the “leaked key” status, even after generating a new key. Sometimes old environment variables, cached configs, or background app processes keep sending requests with the previous key, which makes the system think the leak is still active. Clearing all old .env files, restarting your environment, and creating a completely fresh key often fixes it.
By the way, I recently dealt with a similar issue while working on another project outside this forum, and it reminded me of how important it is to reset everything clean — kind of like how I manage backend workflows on my own site aftermathbailbonds. com.Once the stale configs were removed, the new key worked instantly. Hopefully the same approach helps you too.