Document Directory

Translation Task API

Translation text

/v1/translation/translateTexts

Translate text and return translation results synchronously.

Example

curl
1curl -X POST 'https://dltranslator.com/api/v1/translation/translateTexts' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5  "texts": "[value]",
6  "fromLang": "[string]",
7  "toLang": "[string]"
8}'

Request Parameters

ParametersTypeDefaultDescriptionExample
*textsString[]-

Text to be translated

-
*fromLangString-
  • Source language; the source language cannot be the same as the target language
  • Supported languages: Query
-
*toLangString-
  • Target language; the target language cannot be the same as the source language
  • Supported languages: Query
-
modelString-
  • AI model for translation
  • Supported models: Query
-
fileDescriptionString-

Document description. Improve translation quality by providing additional information, such as extra document background information and other translation requirements.

-

Response

ParametersTypeDefaultDescriptionExample
taskIdString-

Task ID

-
translatedTextsString[]-

Translated text

-
priceInteger-

Total Credits required for the complete translation

-
usedCreditsInteger-

Number of credits used by the translation task

-
Translation Task API
Restart translation task