https://www.skills.google/games/7223/labs/44689
π’
π Scope the results returned from the API to just a single language code.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1120 0 1120 0 0 11101 0 --:--:-- --:--:-- --:--:-- 11200
{
"error": {
"code": 403,
"message": "Your application is authenticating by using local Application Default Credentials. The texttospeech.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds .",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "SERVICE_DISABLED",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/618104708054",
"service": "texttospeech.googleapis.com"
}
},
{
"@type": "type.googleapis.com/google.rpc.LocalizedMessage",
"locale": "en-US",
"message": "Your application is authenticating by using local Application Default Credentials. The texttospeech.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds ."
}
]
}
}
π’β οΈ Issue solved. The key is to activate the service account and then
gcloud config set account $SA.β Working code:
Issue:
gcloud auth activate-service-account "$SA" \ --key-file=tts-qwiklab.json