i have followed the google cloud speech api quickstart of requesting api by using
curl -s -H \"Content-Type: application/json\" \\
-H \"Authorization: B
Replace $(gcloud auth application-default print-access-token)
with what gets printed when you call the command.
I fixed the problem by logging out, and logging in to agree to some new terms and conditions google have made since last time I used google clouds (firebase in my case).
It could be that The Application Default Credentials are not available
Try to login by running
gcloud auth application-default login
And follow the instructions, reference: gcloud auth application-default login
If you want to make sure the authentication process went well, run:
gcloud auth application-default print-access-token
You should see an access token, reference gcloud auth application-default print-access-token
Samir's solution worked for me.
Just a reminder that if using other software interacting with GCP, you may have to restart software before the auth takes effect.
In my case, when using RStudio, I ran gcloud auth application-default login
to authenticate, then command + shift + f10 to restart the R session, and then everything was good to go