Microsoft Azure Translation Service max char limit is 5K. Is this per target language or for the whole string in the request body?

Rajesh Voleti 1 Reputation point
2020-06-03T16:58:00.693+00:00

As per this doc link, https://learn.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-translate

Microsoft Azure Translator Service has a max limit of 5K characters for the string that we pass in the request body which needs to be translated.

In the query parameters, we can also pass multiple languages at a time to translate the given text.

Earlier, we thought we can pass a string of upto 5K characters with multiple languages. However, we observed the following behaviour when tried to translate the text to multiple languages:

  • 1 target language => max limit is being honoured till 5K characters
  • 2 target languages =>max limit is being honoured till 2.5K characters
  • 10 target languages =>max limit is being honoured till 500 characters

Question: Is the max limit 5K characters is per API request or will it be shared per language as mentioned above? This isn't clear in the doc link. Can someone please clarify us on this?

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
343 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,396 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. romungi-MSFT 42,286 Reputation points Microsoft Employee
    2020-06-04T10:53:32.51+00:00

    @RajeshVoleti-4097 The translator essentially counts every unicode code point of input text as a character. Each translation of a text to a language counts as a separate translation, even if the request was made in a single API call translating to multiple languages.

    The character and array limits per request is documented here. So, the maximum limit for each translate request is 5K characters and if your request contains 1500 characters to be translated into 3 languages then it results in request size of 4500 characters as observed.

    You can also check how a character is counted here.


  2. Krishna Doss Mohan 1 Reputation point Microsoft Employee
    2021-10-04T18:46:01.253+00:00
    0 comments No comments