Skip to main content
POST
Translate a user message

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is an access key.

Example: Authorization: Bearer sk-proj-XXXXXXXXX

Body

application/json

A conversation to translate, with its source and target languages.

source_language
enum<string>
required

Source language. See supported languages guides for full language names.

Available options:
EN,
EN_GB,
FR,
FR_BE,
RO,
NL,
ES,
DE,
DE_CH,
DE_AT,
IT,
ES_LATAM,
BG,
HE,
JA,
NL_BE,
EN_AU,
PT_PT,
PT_BR,
SV_SE,
DA_DK,
FI_FI,
PL_PL,
LT_LT,
NB_NO,
NN_NO,
SL_SI,
HU,
HU_HU,
CS_CZ,
EL_GR,
EL_GR_LATIN,
EL_GR_GREEK,
HR_HR,
TR_TR,
EN_IE,
AF_ZA,
ZU_ZA,
LV_LV,
SK_SK,
GA_IE,
SR_RS,
ET_EE,
EN_CA,
FR_CA,
RU_RU,
UA_UA
Example:

"EN"

target_language
enum<string>
required

Target language. See supported languages guides for full language names.

Available options:
EN,
EN_GB,
FR,
FR_BE,
RO,
NL,
ES,
DE,
DE_CH,
DE_AT,
IT,
ES_LATAM,
BG,
HE,
JA,
NL_BE,
EN_AU,
PT_PT,
PT_BR,
SV_SE,
DA_DK,
FI_FI,
PL_PL,
LT_LT,
NB_NO,
NN_NO,
SL_SI,
HU,
HU_HU,
CS_CZ,
EL_GR,
EL_GR_LATIN,
EL_GR_GREEK,
HR_HR,
TR_TR,
EN_IE,
AF_ZA,
ZU_ZA,
LV_LV,
SK_SK,
GA_IE,
SR_RS,
ET_EE,
EN_CA,
FR_CA,
RU_RU,
UA_UA
Example:

"FR"

messages
object[]
required

The conversation messages, oldest first. The last message must be authored by the side matching the route ('user' for /user, 'persona' for /persona).

user_gender
enum<string>
required

Gender of the user (subscriber). Used to apply the correct grammatical gender, agreement, and forms of address in the target language.

Available options:
WOMAN,
MAN
Example:

"MAN"

persona_gender
enum<string>
required

Gender of the persona (animator). Used to apply the correct grammatical gender, agreement, and forms of address in the target language.

Available options:
WOMAN,
MAN
Example:

"WOMAN"

tags
object

Optional key/value tags attached to the request.

Response

200 - */*

OK

The translated text and the cost charged for the translation.

translation
string
required

The translated text.

Example:

"bonjour"

cost
string
required

Cost charged for this translation, formatted to 6 decimals.

Example:

"0.001050"