Translate a File

POST
https://libretranslate.com/translate_file

Body

multipart/form-data
filestring<binary>required

File to translate

sourcestringrequired

Source language code or “auto” for auto detection

Example
en
targetstringrequired

Target language code

Example
es
api_keystring

API key

Example
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Response

Translated file

Response fields application/json
translatedFileUrlstring

Translated file url

400Bad Requesterror-response

Invalid request

Response fields application/json
errorstring

Error message

403Forbiddenerror-response

Banned

Response fields application/json
errorstring

Error message

429Too Many Requestserror-slow-down

Slow down

Response fields application/json
errorstring

Reason for slow down

500Internal Server Errorerror-response

Translation error

Response fields application/json
errorstring

Error message