/translate end point accepts GET and POST requests with the following args:source -- source text. Can be a single string or a batch (i.e., list of strings)src_lang -- source language ID, e.g., eng_Latntgt_lang -- target language ID, e.g., eng_LatnHTTP Clients may send these parameters in three ways:
Query parameters (GET)
For example:
URL encoded form (POST)
$ curl --data "source=Comment allez-vous?" --data "source=Bonne journée" \
--data "src_lang=fra_Latn" --data "tgt_lang=eng_Latn" \
http://localhost:6060/translate
JSON body (POST)
$ curl -H "Content-Type: application/json" -X POST \
http://localhost:6060/translate \
--data '{"source": ["Comment allez-vous?"], "src_lang": "fra_Latn", "tgt_lang": "kan_Knda"}'
| transformer | 4.46.3 |
|---|---|
| Python Version | 3.8.14 (default, Oct 5 2022, 16:02:43) [GCC 8.3.0] |
| Platform | Linux-6.11.0-1025-oem-x86_64-with-glibc2.2.5 |
| Platform Version | #25-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 26 07:31:18 UTC 2025 |
| Processor | |
| GPU | [unavailable] |
| torch | 2.4.1+cu121 |
| model_id | facebook/nllb-200-3.3B |