Translate text
Translate text from one language to another.
The Translation API allows you to translate text from one language to another. See Language support for a list of supported languages.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your Writer API key.
Body
The model to use for translation.
palmyra-translate
The ISO-639-1 language code of the original text to translate. For example, en
for English, zh
for Chinese, fr
for French, es
for Spanish. If the language has a variant, the code appends the two-digit ISO-3166 country code. For example, Mexican Spanish is es-MX
. See the list of supported languages and language codes.
The ISO-639-1 language code of the target language for the translation. For example, en
for English, zh
for Chinese, fr
for French, es
for Spanish. If the language has a variant, the code appends the two-digit ISO-3166 country code. For example, Mexican Spanish is es-MX
. See the list of supported languages and language codes.
The text to translate. Maximum of 100,000 words.
Whether to use formal or informal language in the translation. See the list of languages that support formality. If the language does not support formality, this parameter is ignored.
Whether to control the length of the translated text. See the list of languages that support length control. If the language does not support length control, this parameter is ignored.
Whether to mask profane words in the translated text. See the list of languages that do not support profanity masking. If the language does not support profanity masking, this parameter is ignored.
Response
The result of the translation.
Was this page helpful?