I tried to use the Google Cloud Speech-to-Text API but without any success. I have an API key error.
Here is my api call :
curl -s -H "Content-Type: application/json" \
-H "Authorization: Bearer "$(myapikey) \
https://speech.googleapis.com/v1/speech:recognize \
-d @sync-request.json
sync-request.json content is the following :
{
"config": {
"encoding":"FLAC",
"sampleRateHertz": 48000,
"languageCode": "fr-FR",
"enableWordTimeOffsets": true
},
"audio": {
"uri":"gs://audio-bucket_bl/audio.flac"
}
}
and result is the following :
-bash: myapikey: command not found
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
For your information, I took my api key from here : https://console.cloud.google.com/apis/credentials? (Key 1 from api keys list)
Do you know what I'm doing wrong ? It's about the api key so or it's the wrong one or I do not set it in the good way.
Thank you for your help :)
Best regards,