使用 Google 云翻译 API 当 return 响应 403 "Daily Limit Exceeded"

Used Google Cloud Translation API When return response 403 "Daily Limit Exceeded"

完成以下确认。

所以,直到昨天我才能够正常运行。 但是我今天会一直报错

我用"Cloud Translation API Client Libraries", 如果还有其他要检查的点,请教我好吗?

$translate = new TranslateClient([
    'projectId' => 'xxxxxxx',
]);
$result = $translate->translate('I am playing Dragon Quest 11 ', [
    'source' => 'en',
    'target' => 'ja',
]);

自己解决了。

习惯授权类型'authorized_user'.

不太符合身份验证方法。

我的解决方案是:

构造函数添加选项 'keyFilePath' 目录。

$translate = new TranslateClient([
    'projectId' => 'xxxxxxx',
    'keyFilePath' => env('GOOGLE_APPLICATION_CREDENTIALS')
]);