gpt4 book ai didi

google-cloud-platform - 谷歌云视觉API "PERMISSION_DENIED"

转载 作者:行者123 更新时间:2023-12-01 16:56:18 25 4
gpt4 key购买 nike

我正在尝试 Google Cloud Vision API(测试版),但它返回“权限被拒绝”消息。但该项目启用了“Cloud Vision API”。如有任何帮助,我们将不胜感激。

来自 Google API Explorer 的错误详细信息

403 OK

- Show headers -

{
"error": {
"code": 403,
"message": "Project has not activated the vision.googleapis.com API. Please enable the API for project google.com:apisexplorerconsole (#292824132082).",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/project/292824132082/apiui/api"
}
]
}
]
}
}

最佳答案

您应该首先使用 CURL 请求,而不是 API 浏览器或您最喜欢的编程语言:

curl -v -k -s -H "Content-Type: application/json" https://vision.googleapis.com/v1/images:annotate?key=put_your_browser_secret_key_here --data-binary @put_your_req.json > result.json

{
"requests":[
{
"image":{
"content":"put_your_encoded_base64_image_content"
},
"features":[
{
"type":"LABEL_DETECTION",
"maxResults":4
}
]
}
]
}

正如您可能已经知道的:

base64 your_image > your_encoded_base64_image_content

希望有所帮助,我不知道为什么 API 资源管理器有限制。

关于google-cloud-platform - 谷歌云视觉API "PERMISSION_DENIED",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35532645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com