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
withliveConnectConstraints
andexpireTime
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?