Cloud Translation enforces quotas on the content size of requests and the number of requests that you can send. Quotas protect the community of Google Cloud users by preventing unforeseen spikes in usage. You can also lower your quotas to prevent excessive usage and control costs.
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.
v2 quotas apply to Cloud Translation - Basic and v3 quotas apply to Cloud Translation - Advanced. You can view or edit your quotas by using the Google Cloud Console quotas page.
Content quotas
Content quotas apply to text strings that you send to the Cloud Translation API through
the translateText
and detectLanguage
methods. All
characters that you send to the Cloud Translation API count toward these quotas,
including whitespace characters. These quotas are cumulative if you use
Cloud Translation - Basic and Cloud Translation - Advanced together.
Content Quota | Default |
---|---|
v2 and v3 general model characters per day per project | unlimited |
v2 and v3 general model characters per minute per project | 6,000,000 characters |
v2 and v3 general model characters per minute per project per user* | 6,000,000 characters |
* Per user quotas apply to the number of requests that an end user, who is using a client application, can make per minute. When you use a service account, the service account's identity is the user for quota purposes. If you use Cloud Translation - Basic and an API key, Cloud Translation uses the client's IP address to enforce this limit.
The Cloud Translation API is optimized for translating of smaller requests. The recommended maximum length for each request is 5K characters (code points). However, the more characters that you include, the higher the response latency. For Cloud Translation - Advanced, the maximum number of code points for a single request is 30K. Cloud Translation - Basic has a maximum request size of 100K bytes.
The Cloud Translation API rejects requests larger than the maximum and gives a
400 INVALID_ARGUMENT
error regardless of the available quota.
Request quotas
Cloud Translation applies a quota on the number of requests that you can send to the service.
Quota | Default |
---|---|
Requests for getting supported languages (v2 and v3 combined) per minute per project | 600 requests |
v3 requests per minute per project† | 6000 requests |
v3 requests per minute per project per user*† | unlimited |
Total number of v3 batch translation requests per day per project | unlimited |
* Per user quotas apply to the number of requests that an end user, who is using a client application, can make per minute. When you use a service account, the service account's identity is the user for quota purposes. If you use Cloud Translation - Basic and an API key, Cloud Translation uses the client's IP address to enforce this limit.
† Applies to all Cloud Translation - Advanced method calls
except for the translateText
, detectLanguage
, and getSupportedLanguages
methods.
AutoML quotas
For Cloud Translation - Advanced, you can use models from AutoML to translate content. When you use a custom model, usage is counted against a separate set quotas. For more information about AutoML content and request quotas, see the AutoML Translation documentation.
Counting quotas
For Cloud Translation - Basic, content and request quotas are counted against the project that is making the request, which is determined by the key that is used in the request.
For Cloud Translation - Advanced, content quota is checked against the project that is associated with the model in the request. The request quotas are checked against the project that is making the request.
For example, in the following translate text request, the request quotas are
checked against project-id-1
because the request is coming from
project-id-1
. The content quota is checked against project-id-2
because the
request is using a model in that project.
POST https://translation.googleapis.com/v3/projects/project-id-1/locations/us-central1:translateText { "Model":"projects/project-id-2/locations/us-central1/models/model-id", "sourceLanguageCode": "en", "targetLanguageCode": "ru", "contents": ["Dr. Watson, please discard your trash."] }
Cloud Translation - Advanced limits
The following table describes Cloud Translation - Advanced limits, which cannot be changed.
Description | Limit |
---|---|
Maximum number of files that you can include in a single batch request | 100 files |
Maximum number of glossary resources for a project | 1,000 |