ISSUE DESCRIPTION
I am experiencing a consistent authentication problem when using the Gemini Live API with the following model:
gemini-2.5-flash-native-audio-preview-09-2025
Whenever I attempt to connect, the WebSocket is closed immediately with this message:
Your API key was reported as leaked. Please use another API key.
The WebSocket close code is always 1008 (policy violation).
The important part is that the same API key works perfectly with other Gemini model:
- gemini-2.0-flash-exp
So the API key is valid, active, and not leaked. The problem happens only when using the 2.5 native audio preview model.
EXPECTED BEHAVIOR
The API key should authenticate normally and create a Live session with the model gemini-2.5-flash-native-audio-preview-09-2025, just like it does with all other models.
ACTUAL BEHAVIOR
-
The Live API rejects the WebSocket connection.
-
It returns a leaked-key error even though the key works elsewhere.
-
This behavior appears model-specific.
HOW TO REPRODUCE
Use this minimal Python script:
(import asyncio
from google import genai
client = genai.Client(api_key=“YOUR_KEY”)
async def main():
model = “gemini-2.5-flash-native-audio-preview-09-2025”
config = {“response_modalities”: [“AUDIO”]}
async with client.aio.live.connect(model=model, config=config) as session:
print("connected")
await session.send("hello", end_of_turn=True)
async for resp in session.receive():
print(resp)
if name == “main”:
asyncio.run(main())
)
The output is always:
WebSocket closed: 1008 (policy violation)
Your API key was reported as leaked. Please use another API key.
If I change the model name to:
gemini-2.0-flash-exp
the exact same code and API key work without any issues.
ADDITIONAL DETAILS
-
The key is not leaked anywhere publicly (checked).
-
This error happens only with the 2.5 native audio model.
-
I am using Python 3.11, Ubuntu 22.04, latest google-genai SDK (v1alpha).
-
My backend uses FastAPI WebSockets, but the issue also occurs in a clean Python script (above).
CONCLUSION
This seems to be a false leak detection or authentication error specific to the model:
gemini-2.5-flash-native-audio-preview-09-2025
All other models behave normally with the same key.
Requesting confirmation from the Gemini team and guidance on whether this model requires different API key scopes, if the leak detection is mis-triggered, or if this is a backend regression.
