adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

received 1008 (policy violation) <Live Model Name> is not found for API version v1alpha, or is not supported for bidiGenerateContent

Open ravi-incred opened this issue 11 months ago • 15 comments

Describe the bug

I had built an ADK Agent using Google Gemini LIVE Models for audio-to-audio conversation and suddenly my ADK Agent stoped working and later reading the server logs I found out this message:

Connection closed: received 1008 (policy violation) models/gemini-live-2.5-flash-preview is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent.
WebSocket error: received 1008 (policy violation) models/gemini-live-2.5-flash-preview is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent

Note - I am using Google ADK with Google AI Studio setup my .env look like this

GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_API_KEY=<KEY>

Additional Context

I tried 3 models hoping that maybe its a model issue

  • models/gemini-live-2.5-flash-native-audio
  • models/gemini-live-2.5-flash-preview
  • models/gemini-live-2.5-flash But got the same response
Connection closed: received 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent.
WebSocket error: received 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent


Connection closed: received 1008 (policy violation) models/gemini-live-2.5-flash-preview is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent.
WebSocket error: received 1008 (policy violation) models/gemini-live-2.5-flash-preview is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent

onnection closed: received 1008 (policy violation) models/gemini-live-2.5-flash is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent.
WebSocket error: received 1008 (policy violation) models/gemini-live-2.5-flash is not found for API version v1alpha, or is not supported for bidiGenerateContent; then sent 1008 (policy violation) models/gemini-live-2.5-flash-native-audio is not found for API version v1alpha, or is not supported for bidiGenerateContent

Is there any issue with Google AI Studio API ?? Do I need to migrate to Google Vertex AI Studio?

ravi-incred avatar Dec 18 '25 07:12 ravi-incred

Update, I also tried running the same via @google/genai Javascript library. Getting the same error there as well. Sharing the code snippet used for running the code

           import {
              GoogleGenAI,
              LiveServerMessage,
              MediaResolution,
              Modality,
              Session,
          } from '@google/genai';

            ...code...
      
             const ai = new GoogleGenAI({
                 apiKey: this.apiKey,
             });

            ...code...

            this.session = await ai.live.connect({
                model: this.model,
                callbacks: {
                    onopen: () => {
                        console.log('[GeminiLive] ✅ WebSocket ONOPEN callback triggered!');
                        this.isActive = true;
                        console.log('[GeminiLive] 🟢 Session is now ACTIVE');
                    },
                    onmessage: (message: LiveServerMessage) => {
                        this.responseQueue.push(message);
                        this.handleMessage(message);
                    },
                    onerror: (e: ErrorEvent) => {
                        console.error('[GeminiLive] ❌ WebSocket ERROR callback triggered!');
                        console.error('[GeminiLive] Error details:', e);
                        console.error('[GeminiLive] Error message:', e.message);
                    },
                    onclose: (e: CloseEvent) => {
                        console.log('[GeminiLive] 🔌 WebSocket ONCLOSE callback triggered!');
                        console.log('[GeminiLive] Close reason:', e.reason, 'code:', e.code);
                        this.isActive = false;
                        console.log('[GeminiLive] 🔴 Session is now INACTIVE');
                    },
                },
                config
            });

Error message

[GeminiLive] Close reason: models/gemini-live-2.5-flash-native-audio is not found for API version v1beta, or is not supported for bidiGenerateContent. code: 1008

ravi-incred avatar Dec 19 '25 18:12 ravi-incred

Same issue for me. The model suddenly stopped working. No changes were made to the code and yet this behaviour suddenly appeared.

{ insertId: "69484941000d06204d72a3ae" labels: {1} logName: "projects/xxxxxx/logs/run.googleapis.com%2Fstderr" payload: "textPayload" receiveLocation: "us-central1" receiveTimestamp: "2025-12-21T19:23:46.076984667Z" resource: {2} severity: "DEFAULT" textPayload: "ERROR:google_adk.google.adk.flows.llm_flows.base_llm_flow:Connection closed: received 1008 (policy violation) Publisher Model projects/xxxxxx/locations/global/publishers/google/models/gemini-live-2.5-flash-native-audio wa; then sent 1008 (policy violation) Publisher Model projects/xxxxxxxxx/locations/global/publishers/google/models/gemini-live-2.5-flash-native-audio wa." timestamp: "2025-12-21T19:23:45.853536Z" traceSampled: false }

bijucyborg avatar Dec 21 '25 19:12 bijucyborg

+1

vfa-tanna avatar Dec 25 '25 07:12 vfa-tanna

Hello,

Based on the information shared by @ravi-incred , it appears this issue might be related to the Gemini API rather than the Google ADK. We recommend running additional tests using google.genai and Vertex AI to isolate the problem:

  1. If these tests work correctly: We will investigate the ADK in more detail to identify the cause.
  2. If the issue persists with these tools: The problem likely lies with the API. In that case, we recommend reaching out to the dedicated support teams via the google.genai Python/JS GitHub repositories or the Google AI Forum."

llalitkumarrr avatar Dec 31 '25 06:12 llalitkumarrr

@llalitkumarrr after I switched to Vertex AI studio, now it is working

ravi-incred avatar Dec 31 '25 09:12 ravi-incred

Hello @ravi-incred ,

Thank you for the update. Could you please clarify if you used google.genai with VertexAI or google-adk with VertexAI to test this?

If you used google-adk with VertexAI, it implies the issue may be related to the Gemini API rather than the google-adk library itself. If you are comfortable working with VertexAI, you can proceed as is. However, if you prefer not to, we recommend raising this concern on the google.genai GitHub repository or the Google AI forum for faster support."

llalitkumarrr avatar Jan 06 '26 07:01 llalitkumarrr

@llalitkumarrr after I switched to Vertex AI studio, now it is working

does it still working?without error.

Adhishtanaka avatar Jan 09 '26 04:01 Adhishtanaka

Yes still working after switching to VERTEX AI

On Fri, 9 Jan, 2026, 10:25 am Adhishtanaka Kulasooriya, < @.***> wrote:

Adhishtanaka left a comment (google/adk-python#3964) https://github.com/google/adk-python/issues/3964#issuecomment-3727192048

@llalitkumarrr https://github.com/llalitkumarrr after I switched to Vertex AI studio, now it is working

does it still working?without error.

— Reply to this email directly, view it on GitHub https://github.com/google/adk-python/issues/3964#issuecomment-3727192048, or unsubscribe https://github.com/notifications/unsubscribe-auth/BTX4YIIZSOOP6XPLQLRH7334F4YDTAVCNFSM6AAAAACPMU7FJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOMRXGE4TEMBUHA . You are receiving this because you were mentioned.Message ID: @.***>

ravi-incred avatar Jan 09 '26 05:01 ravi-incred

Same error faced now !! Sometime it's coming , but i'm not sure about this caused by deprecated model because i have used latest December preview model using gemini API not vertex ai

error : [TIMING:897bcb6a] 🤖 AI transcription: of five....: 72922ms [AI] 🤖 of five. [TIMING:897bcb6a] 🤖 AI transcription: Just...: 73520ms [AI] 🤖 Just [TIMING:897bcb6a] 🤖 AI transcription: a moment....: 73562ms [AI] 🤖 a moment. Connection closed: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled.. [GEMINI:897bcb6a-3478-4b66-b08b-9926a5f46141] Error: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled. Traceback (most recent call last): File "C:\Users\admin\Desktop\livekit\gateway\main.py", line 257, in _run_gemini_session async for event in self.runner.run_live( File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 1000, in run_live async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 722, in _exec_with_plugin async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 989, in execute async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\agents\base_agent.py", line 327, in run_live async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\agents\llm_agent.py", line 484, in _run_live_impl async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\flows\llm_flows\base_llm_flow.py", line 219, in run_live await send_task File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\flows\llm_flows\base_llm_flow.py", line 278, in _send_to_model await llm_connection.send_realtime(live_request.blob) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\models\gemini_llm_connection.py", line 121, in send_realtime await self._gemini_session.send_realtime_input(media=input) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\genai\live.py", line 343, in send_realtime_input await self._ws.send(json.dumps({'realtime_input': realtime_input_dict})) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\websockets\asyncio\connection.py", line 476, in send async with self.send_context(): File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\websockets\asyncio\connection.py", line 957, in send_context raise self.protocol.close_exc from original_exc websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled.

B-Sairam avatar Jan 11 '26 06:01 B-Sairam

Hi Guys, I have confirmed this with the GCP team they have recommended that we should use vertex AI studio if possible instead of API key method for more reliability for production applications.

On Sun, 11 Jan, 2026, 11:36 am SAIRAM, @.***> wrote:

B-Sairam left a comment (google/adk-python#3964) https://github.com/google/adk-python/issues/3964#issuecomment-3734071608

Same error faced now !! Sometime it's coming , but i'm not sure about this caused by deprecated model because i have used latest December preview model using gemini API not vertex ai

error : [TIMING:897bcb6a] 🤖 AI transcription: of five....: 72922ms [AI] 🤖 of five. [TIMING:897bcb6a] 🤖 AI transcription: Just...: 73520ms [AI] 🤖 Just [TIMING:897bcb6a] 🤖 AI transcription: a moment....: 73562ms [AI] 🤖 a moment. Connection closed: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled.. [GEMINI:897bcb6a-3478-4b66-b08b-9926a5f46141] Error: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled. Traceback (most recent call last): File "C:\Users\admin\Desktop\livekit\gateway\main.py", line 257, in _run_gemini_session async for event in self.runner.run_live( File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 1000, in run_live async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 722, in _exec_with_plugin async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 989, in execute async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\agents\base_agent.py", line 327, in run_live async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\agents\llm_agent.py", line 484, in _run_live_impl async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\flows\llm_flows\base_llm_flow.py", line 219, in run_live await send_task File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\flows\llm_flows\base_llm_flow.py", line 278, in _send_to_model await llm_connection.send_realtime(live_request.blob) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\models\gemini_llm_connection.py", line 121, in send_realtime await self._gemini_session.send_realtime_input(media=input) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\genai\live.py", line 343, in send_realtime_input await self._ws.send(json.dumps({'realtime_input': realtime_input_dict})) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\websockets\asyncio\connection.py", line 476, in send async with self.send_context(): File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\websockets\asyncio\connection.py", line 957, in send_context raise self.protocol.close_exc from original_exc websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled.

— Reply to this email directly, view it on GitHub https://github.com/google/adk-python/issues/3964#issuecomment-3734071608, or unsubscribe https://github.com/notifications/unsubscribe-auth/BTX4YILSFSIT7CJPDRJEAQ34GHR6JAVCNFSM6AAAAACPMU7FJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOMZUGA3TCNRQHA . You are receiving this because you were mentioned.Message ID: @.***>

ravi-incred avatar Jan 11 '26 06:01 ravi-incred

Same error faced now !! Sometime it's coming , but i'm not sure about this caused by deprecated model because i have used latest December preview model using gemini API not vertex ai

error : [TIMING:897bcb6a] 🤖 AI transcription: of five....: 72922ms [AI] 🤖 of five. [TIMING:897bcb6a] 🤖 AI transcription: Just...: 73520ms [AI] 🤖 Just [TIMING:897bcb6a] 🤖 AI transcription: a moment....: 73562ms [AI] 🤖 a moment. Connection closed: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled.. [GEMINI:897bcb6a-3478-4b66-b08b-9926a5f46141] Error: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled. Traceback (most recent call last): File "C:\Users\admin\Desktop\livekit\gateway\main.py", line 257, in _run_gemini_session async for event in self.runner.run_live( File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 1000, in run_live async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 722, in _exec_with_plugin async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\runners.py", line 989, in execute async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\agents\base_agent.py", line 327, in run_live async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\agents\llm_agent.py", line 484, in _run_live_impl async for event in agen: File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\flows\llm_flows\base_llm_flow.py", line 219, in run_live await send_task File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\flows\llm_flows\base_llm_flow.py", line 278, in _send_to_model await llm_connection.send_realtime(live_request.blob) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\adk\models\gemini_llm_connection.py", line 121, in send_realtime await self._gemini_session.send_realtime_input(media=input) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\google\genai\live.py", line 343, in send_realtime_input await self._ws.send(json.dumps({'realtime_input': realtime_input_dict})) File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\websockets\asyncio\connection.py", line 476, in send async with self.send_context(): File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\admin\Desktop\livekit\gateway\venv\Lib\site-packages\websockets\asyncio\connection.py", line 957, in send_context raise self.protocol.close_exc from original_exc websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Operation is not implemented, or supported, or enabled.; then sent 1008 (policy violation) Operation is not implemented, or supported, or enabled.

I ran into the same issue with the same model and got the exact error. After switching from models/gemini-2.5-flash-native-audio-preview-12-2025 to models/gemini-2.5-flash-native-audio-preview-09-2025, it started working.

But now I'm considering moving to the Vertex API since this app runs in a production environment. If something breaks again, the whole system is at risk. I have already lost three days on this issue, and I cannot afford to go through that again.

Adhishtanaka avatar Jan 11 '26 07:01 Adhishtanaka

Hi @Adhishtanaka sharing how I configured using Vertex AI so that you don't have to waste time there, because I found very less documentation regarding this. Three methods are there you can use to authenticate with Vertex AI using Google ADK

  1. use vertex cloud (this is well documented, but I didn't want to use this because I had deployed a custom solution on my own server with custom settings)
  2. using google cloud cli (this also you can find the documentation easily, but this requires you to run gcloud authentication during deployment )
  3. use oAuth file to authenticate with Vertex AI (very simple and straightforward, you can store this file on some kind of secret manager and save it on your server during deployment)

Here I am only writing about Method 3.

  • Generate the oAuth file using google console refer these links https://docs.cloud.google.com/vertex-ai/docs/authentication#rest https://docs.cloud.google.com/docs/authentication/application-default-credentials https://support.google.com/cloud/answer/15549257 Credentials JSON file will look like this, with actual values
{
    "type": "service_account",
    "project_id": "",
    "private_key_id": "",
    "private_key": "",
    "client_email": "",
    "client_id": "",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "",
    "universe_domain": "googleapis.com"
}
  • Configure the below env variables
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_CLOUD_PROJECT=gen-lang-client-XXX
GOOGLE_CLOUD_LOCATION=us-central1
GOOGLE_APPLICATION_CREDENTIALS=<path_to_your_credentials_json_file_on_your_server>
  • You might receive this error like this, just go to console and enable this settings

ERROR: (gcloud.auth.application-default.set-quota-project) Cannot add the project "gen-lang-client-XXX" to application default credentials (ADC) as a quota project because the account in ADC does not have the "serviceusage.services.use" permission on this project.

Also, @llalitkumarrr can we add this to documentation somewhere? so that people can find it easy to migrate to Vertex AI when they want to deploy the code to their own server.GOOGLE_APPLICATION_CREDENTIALS this variable was also very hard to find.

ravi-incred avatar Jan 12 '26 13:01 ravi-incred

Hello @ravi-incred ,

Thank you for sharing such detailed information. Your feedback is very valuable to us, we will review this and take the necessary steps.

llalitkumarrr avatar Jan 14 '26 05:01 llalitkumarrr

Hi @Adhishtanaka sharing how I configured using Vertex AI so that you don't have to waste time there, because I found very less documentation regarding this. Three methods are there you can use to authenticate with Vertex AI using Google ADK

  1. use vertex cloud (this is well documented, but I didn't want to use this because I had deployed a custom solution on my own server with custom settings)
  2. using google cloud cli (this also you can find the documentation easily, but this requires you to run gcloud authentication during deployment )
  3. use oAuth file to authenticate with Vertex AI (very simple and straightforward, you can store this file on some kind of secret manager and save it on your server during deployment)

Here I am only writing about Method 3.

  • Generate the oAuth file using google console refer these links https://docs.cloud.google.com/vertex-ai/docs/authentication#rest https://docs.cloud.google.com/docs/authentication/application-default-credentials https://support.google.com/cloud/answer/15549257 Credentials JSON file will look like this, with actual values

{ "type": "service_account", "project_id": "", "private_key_id": "", "private_key": "", "client_email": "", "client_id": "", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "", "universe_domain": "googleapis.com" }

  • Configure the below env variables

GOOGLE_GENAI_USE_VERTEXAI=TRUE GOOGLE_CLOUD_PROJECT=gen-lang-client-XXX GOOGLE_CLOUD_LOCATION=us-central1 GOOGLE_APPLICATION_CREDENTIALS=<path_to_your_credentials_json_file_on_your_server>

  • You might receive this error like this, just go to console and enable this settings

ERROR: (gcloud.auth.application-default.set-quota-project) Cannot add the project "gen-lang-client-XXX" to application default credentials (ADC) as a quota project because the account in ADC does not have the "serviceusage.services.use" permission on this project.

Also, @llalitkumarrr can we add this to documentation somewhere? so that people can find it easy to migrate to Vertex AI when they want to deploy the code to their own server.GOOGLE_APPLICATION_CREDENTIALS this variable was also very hard to find.

Thanks Brother, i will do that

Adhishtanaka avatar Jan 14 '26 05:01 Adhishtanaka

Closing this issue as a fix is now available. Please feel free to reach out if you have any further questions.

llalitkumarrr avatar Feb 05 '26 08:02 llalitkumarrr