Your API key was reported as leaked. Please use another API key.
The message
Your API key was reported as leaked. Please use another API key.What it means
Google found your API key exposed somewhere public and has blocked it from the Gemini API for good. Your code and your quota are fine; the key is what's dead.
What to do
Create a new key in Google AI Studio, find where the old one was exposed (a public repo, a web app's bundle) and remove it there. Don't retry the old key.
The Gemini API refuses every request from a key Google has flagged as public. Through Google's Python SDK it looks like this, from an April 2026 report:
403 PERMISSION_DENIED. {'error': {'code': 403, 'message': 'Your API key was reported as leaked. Please use another API key.', 'status': 'PERMISSION_DENIED'}}
The HTTP status is 403, and the SDK (google-genai, we read 2.25.0) raises a ClientError. It's getting more common: 405 GitHub issues and pull requests quote the message as of September 25, 2026, and 345 of them are from June onward.
What Google says happened
This one is documented, which is rare for Gemini errors. Google's troubleshooting page says it found "a vulnerability where some API keys may have been publicly exposed," and has "proactively blocked these known leaked keys from accessing the Gemini API." Then, plainly: "If your key is known to be leaked, you can no longer use that key with the Gemini API." The page offers no way to unblock one. The AI Studio keys page shows which of your keys are blocked.
Google is also tightening things generally. Its API key page says new keys made in AI Studio since May 28, 2026 are "auth keys" tied to a service account, with "fast-acting leaked key enforcement."
Where keys leak from
The reports we read point at two places. One team found theirs committed to the repo in an env.yaml file. Another had its key in a VITE_ environment variable, which (as that report points out) Vite, a JavaScript build tool, inlines into the bundle every visitor's browser downloads. A key in client-side code is public however private the repo is.
If someone ran up charges on the key before it was blocked, Google's page says to submit a billing support case.
What to do
Make a new key in Google AI Studio, then update it everywhere the old one lived, from your .env file to your CI and hosting secrets. Delete the old key once the new one works. Before you deploy the new key, move any Gemini call that runs in the browser to a server of yours, or the replacement will be found the same way.
The docs also suggest restricting keys, either to the Gemini API only (a button on the AI Studio keys page) or to certain IP addresses. Those restrictions make a leaked key less useful to whoever finds it.
Don't retry. Google's troubleshooting page says not to retry a 403, and the SDK doesn't retry one either. One project found its own code treating this error as temporary and starting fresh sandboxes for each attempt, which only burned money.
A different 403 you might see
Some Gemini 403s have nothing to do with keys. As of September 2026, Gemini 3.1 and newer models on the Gemini API reject an image passed as an outside web link with 403 PERMISSION_DENIED: The caller does not have permission. A Vercel AI SDK maintainer confirmed on September 8 that it's a Gemini API bug Google is fixing. Upload the file or send its bytes inline until then.
Other lines the same feature prints
Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.
403 PERMISSION_DENIED. {'error': {'code': 403, 'message': 'Your API key was reported as leaked. Please use another API key.', 'status': 'PERMISSION_DENIED'}}PERMISSION_DENIED