Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Google Gemini API error

Gemini API: "Your API key was reported as leaked. Please use another API key": what it means and how to fix it

Error message
Your API key was reported as leaked. Please use another API key.

Retry? NoLast verified 2 documented fixes1 source

What it means

Google proactively blocks API keys known to have been publicly exposed from accessing the Gemini API. A blocked key can no longer be used.

Causes

  • The API key was publicly exposed and identified as leaked

How to fix it

  1. Fix 1.

    Check key status in Google AI Studio and generate new API keys there; keep new keys out of public places.

  2. Fix 2.

    For unexpected charges caused by a leaked key, submit a billing support case.

More Gemini API errors

All 30 Gemini API errors

FAQ

What does the Gemini API error "Your API key was reported as leaked. Please use another API key" mean?

Google proactively blocks API keys known to have been publicly exposed from accessing the Gemini API. A blocked key can no longer be used.

How do I fix Gemini API "Your API key was reported as leaked. Please use another API key"?

There are 2 documented fixes. Start with the first: Check key status in Google AI Studio and generate new API keys there; keep new keys out of public places.

Should I retry Gemini API "Your API key was reported as leaked. Please use another API key"?

No. The official docs treat this error as not retryable: fix the cause before sending the request again.

Sources

Last verified against 1 source: Gemini API's official docs and official SDK repositories.

Newsletter

Know when the APIs change

One email per week. New model releases, API changes, what broke, and how developers are working around it.