Google Gemini stream termination after OAuth2 token refresh failure
Problem A live streaming service continuously sends audio/video frames to the Google Gemini API using the generateContent streaming endpoint. Every few hours the stream terminates with an authentication error similar to: ERROR: 401 Unauthorized detail: Invalid or expired OAuth2 token The termination is abrupt: the client receives an HTTP 401, the underlying gRPC stream is … Read more