I have confirmed the below things:
Confirmed GEMINI_API_KEY exists and has versions in Secret Manager.
-
Confirmed
apphosting.yamlcorrectly configured (e.g., runConfig: maxInstances: 1, secrets: GEMINI_API_KEY -
Confirmed
940461553688@cloudbuild.gserviceaccount.comhas theSecret Manager Secret Accessorrole in IAM (both at project-level and verified at secret-level). -
Confirmed
940461553688-compute@developer.gserviceaccount.comalso hasSecret Manager Secret Accessor. -
Ran
firebase apphosting:secrets:grantaccess GEMINI_API_KEY --backend studio --project glyphforge-wg95q. -
Gemini api is enabled for the project
The server logs shows message: ‘API key not valid. Please pass a valid API key.’ I have checked the secret manager the key is available, there are 2 versions, one created by the firebase itseld and other from the ai studio,
What to do now? Any suggestions.