In Google AI Studio Build, the Code Assistant chat fails with JetskiAgentService.InvokeAgent ... INVALID_ARGUMENT: API key expired, even though:
-
the same paid Gemini API key works successfully against
generativelanguage.googleapis.comvia curl, -
GEMINI_API_KEYis set in Secrets, -
GOOGLE_API_KEYwas also added with the same value, -
the project was remixed and the issue persists,
-
Chat settings explicitly show “You’re currently using your API key”.
This suggests the Build Code Assistant runtime is not using the same effective authentication context as the direct Gemini API.