I am using the following code:
require 'vendor/autoload.php';
use Google\Cloud\Translate\V2\TranslateClient;
$API_KEY='my-key';
$translate = new TranslateClient([
'key' => $API_KEY
]);
// Translate text from english to french.
$result = $translate->translate('Hello world!', [
'target' => 'fr',
'restOptions' => [
'headers' => [
'referer' => 'http://localhost:4001'
]
]
]);
This would basically result in the following error:
Quoting the documentation, it says: "The error message states Daily Limit Exceeded if you exceeded a daily quota or User Rate Limit Exceeded if you exceeded a per minute quota.". I have waited more than one minute and still the same problem. Does anyone has an idea?
NOTE: I am using laravel artisan tinker
to perform the code above as a script
There are sevral types of quotas.
Once you have caped out a daily quota you need to wait until midnight west coast usa time for it to reset.
If you exceed your quota, Cloud Translation returns a 403 error. The error message states Daily Limit Exceeded if you exceeded a daily quota or User Rate Limit Exceeded if you exceeded a per minute quota.
Daily quotas reset at midnight Pacific Time, which means new quotas can take up to 24 hours to become effective.