Hello Google team and community,
For the past ~2 days (starting early March 2026), I’m facing a consistent issue when deploying directly from the “Deploy” button in Google AI Studio to Cloud Run:
-
The app uses the auto-generated backend proxy (/api-proxy/).
-
In the browser console logs (and the WebSocket URL itself), the placeholder is never replaced: wss://[my-service-name].run.app/api-proxy//ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key=MY_GEMINI_API_KEY
-
This causes a WebSocket connection failure (“failed”) + error event, since no valid key is sent to Gemini.
This exact same prompt/project/model was deploying and working perfectly until 2–3 days ago.
What I’ve already tried (without success):
-
Regenerating the API key on https://aistudio.google.com/app/apikey
-
Deleting and re-creating the deployment from AI Studio
-
Manually adding/correcting the environment variable in Cloud Run (both GEMINI_API_KEY and GOOGLE_API_KEY) → the frontend/proxy still shows the placeholder
-
Adding a client-side form in the app to input the key → ignored, because the generated code forces server-side proxy usage
-
Exporting the code + local testing with .env file → works fine locally, but I’d prefer the one-click deploy for simplicity
Additional details:
-
Model used: [add your model here, e.g., gemini-1.5-flash or gemini-2.0-flash-exp]
-
Cloud Run region: us-west1
-
App type: streaming / BidiGenerateContent via WebSocket (chat with history or multimodal)
-
Exact browser console error: WebSocket connection to ‘[URL]’ failed + Error Event object
Is this a known bug related to recent security/proxy changes (late 2025 / early 2026)?
Is there a missing toggle or extra step to ensure server-side key injection?
Or is the one-click Cloud Run deployment temporarily broken for WebSocket-based apps?
Thanks a lot for any help, workaround, or confirmation!
Happy to provide more logs, screenshots, or the exact project setup if needed.
Best regards,