我正在使用以下命令向Google云语音文本API发送请求:
{
"config": {
"languageCode": "en-US",
"enableSpeakerDiarization": true,
"model": "phone_call",
"useEnhanced": true,
"profanityFilter": false,
"enableAutomaticPunctuation": true,
"metadata": {
"interactionType": "PHONE_CALL"
}
},
"audio": {
"uri": "gs://SOME_BUCKET/d44766a1-a83c-44ae-93d8-a606e126e4cb.flac"
}
}
但是,我得到了答复:
{
"error": {
"code": 429,
"message": "Quota exceeded for quota metric 'speech.googleapis.com/default_requests' and limit 'DefaultRequestsPerMinutePerProject' of service 'speech.googleapis.com' for consumer 'project_number:292824132082'.",
"status": "RESOURCE_EXHAUSTED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developer console API key",
"url": "https://console.developers.google.com/project/myID/apiui/credential"
}
]
}
]
}
}
现在这对我来说并没有太大意义,因为我的配额甚至还没有接近达到目标:
此外,我怀疑这是一个长度问题,因为我的FLAC文件只有5MB(不到3分钟)。还有什么呢?
更新
多亏Christopher,我们到了!当我curl
时,我得到:
{
"error": {
"code": 403,
"message": "Anonymous caller does not have storage.objects.get access to SOME_BUCKET/d44766a1-a83c-44ae-93d8-a606e126e4cb.flac.",
"status": "PERMISSION_DENIED"
}
}
那么,如何确保我的API调用可以访问该存储桶,而不必将其显式公开给全世界?