Gemini Live API throws 1011: The service is currently unavailable

Hi team,

I’m testing ephemeral tokens with the Gemini Live API (v1alpha).

Setup

  • Model: gemini-2.0-flash-live-001
  • Token: Created via authTokens.create with liveConnectConstraints and expireTime set to 30 minutes
  • Client: Electron app (Node.js) connecting via WebSocket to
wss://generativelanguage.googleapis.com//ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentConstrained?access_token=auth_tokens/<mytoken>

Behavior

  • On first connection, the ephemeral token works fine.
  • After ~10 minutes, the WebSocket disconnects (as expected due to connection lifetime limits).
  • I attempt to reconnect using the same ephemeral token (still valid, not expired) and the previous resumptionId.
  • Instead of resuming the session, the server closes immediately with:
The service is currently unavailable

My understanding

  • Documentation suggests ephemeral tokens remain valid until expireTime and should allow resumption within that window.
  • In practice, the token works only for the first session. Any reconnection with the same token and resumption ID fails, even though the token has not expired.

Question

  • Is this expected behavior (ephemeral tokens cannot be reused for session resumption), or is this a bug?
  • If ephemeral tokens are supposed to support multiple reconnects until expiry, what’s the correct way to resume a Live session without creating a new ephemeral token each time?

i am having this same exact issue, i thought we could just keep extending the session

Hello,

Welcome to the Forum!

Ideally, you should be able to reconnect until the expireTime. However, please note that you may need to reconnect multiple times since the connection ends after 10 minutes. We recommend reviewing the session management documentation for more details.

If this does not resolve your issue, we will need to analyze it further. For that, could you please share the reproduction steps and relevant code snippets?