Gemini Live API rejects valid API key for 2.5 Flash Native Audio model but works for 2.0 Flash Exp

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.

Hi @Hamza_Khalid
I couldn’t replicate the issue with the code you shared it’s working fine for me. Could you please share a screenshot of the error? Also, could you confirm if you are currently on a paid tier?|
Thanks

here is the ss of the error i faced , and Yes i am on a paid tier.

Hi @Hamza_Khalid,
I am unable to reproduce the error, and code is working fine from my end. Could you please confirm, if you are still facing this issue?