如何获取 google 云视觉 api 的使用数据?

How can I get usage data for the google cloud vision api?

我想知道是否可以通过编程找出 api 被使用了多少次。控制台中项目的 api 使用情况页面一直报告零使用情况,配额页面有点延迟,但确实报告当天发生了多少使用情况。理想情况下,我正在寻找 api 我可以打电话告诉我当月发生了多少每种类型的请求,这样我就可以确定我要支付多少费用。

您可以使用 Audit Logging API for this. I export my logs to BigQuery and then query them for usage. There is a tutorial on how to set this up here,但示例查询是针对已弃用的版本 1。