GOOGLE_APPLICATION_CREDENTIALS error

Viewed 31550

I am trying to use the google speech API for converting an audio file to text, but facing some problems with the documentation.I have enabled the speech API and created an service account file. I also got the service account credentials activated. Then I wrote the following command to retrieve the authorization token using my service account.

gcloud auth application-default print-access-token

But it is returning this message enter image description here

I don't understand why this is happening because I already have an VM instance created in my Compute Engine. Can anybody explain where am I going wrong with this? Also, is there any other way to authenticate my account and call the google speech API?

3 Answers

you can generate your key json file on gcloud using this command: gcloud auth application-default login

google will display a link to confirm, once you do, there will be the json file ina temp folder displayed

enter image description here

Related