.env
file with the name WRITER_API_KEY
.POST /v1/translation
Parameter | Type | Description |
---|---|---|
model | string | The model to use for the translation. Must be palmyra-translate . |
source_language_code | string | 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. |
target_language_code | string | The ISO-639-1 language code of the target language. 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. |
text | string | The text to translate. |
formality | Boolean | If the target language supports formal or informal language, this parameter controls whether to use formal (true ) or informal language (false ). See which languages support formality. |
length_control | Boolean | If the target language supports length control, this parameter controls whether to control the length of the translation. See which languages support length control. |
mask_profanity | Boolean | If the target language supports profanity masking, this parameter controls whether to mask profane words. See which languages support profanity masking. |
data
field that contains the translated text as a string.