Phuong Phan
Phuong Phan

Reputation: 147

Billing/quota issue when use google cloud api

I got this error from google cloud though I enabled billing and set quota for text-to-speech already, anyone can help me?

enter image description here enter image description here

Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the texttospeech.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/.

Upvotes: 6

Views: 5698

Answers (1)

DazWilkin
DazWilkin

Reputation: 40261

IIUC, you misread the guidance.

The response says that you may not authenticate using (your) end-user credentials (i.e. [email protected] or your email address for some Google Apps domain).

Rather you must authenticate using a Google Service Account.

I assume (!?) that the Text-to-Speech service is most commonly used by software and it is not intended to be used directly by humans.

The best solution is to create a service account and use Application Default Credentials to run code as this account. The guidance offers an alternative (works but not ideal) of using gcloud auth activate-service-account:

See:

https://cloud.google.com/text-to-speech/docs/quickstart-protocol https://cloud.google.com/docs/authentication/production https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account

Upvotes: 3

Related Questions