Skip to content

Quick Translation (Neural Network Translation) ​

Firefox Translations provides neural network translation models organized by language pair. The mtrans service in the AI Pod provides text translation, batch translation, language detection, and compatible endpoints for Immersive Translate, Kiss Translator, Selection Translate, and DeepLX.

This document covers the firefox-translations-93-pairs model resource and the service verified at http://192.168.1.224:18126 on 2026-10-12. Its API behavior matches LinguaSpark Server. Mozilla's training and inference documentation describes the models and training process; the server defines the HTTP request format.

Service Addresses and Models ​

  • AI Pod API address:
  • Health check:
  • LAN service address used for this verification: http://192.168.1.224:18126. For other devices, replace it with the actual IP address and mapped port.
  • Model resource ID: firefox-translations-93-pairs.
  • Full model repository ID: manateelazycat/firefox-translations-93-pairs.
  • POST requests use Content-Type: application/json.

Requests do not need a model parameter. The service selects a loaded language-pair model based on from and to; the model resource ID identifies the model collection and is not a request parameter.

The current service returns 404 for /v1/models and /v1/chat/completions. Use the translation endpoints below when integrating it, without adding /v1 to the base address.

Endpoint List ​

All 8 endpoints below were tested on the service above and returned 200.

MethodPathPurposeMain Request Fields or Response Content
POST/translateSingle or batch translationtext, from, to; returns translated text and language codes
POST/detectLanguage detectiontext; returns language
POST/immeImmersive Translate compatible endpointtext_list, source_lang, target_lang; returns translations
POST/kissKiss Translator compatible endpointtext, from, to; returns translated text and language codes
POST/hcfySelection Translate compatible endpointtext, source, destination; translated text is in the result array
POST/deeplxDeepLX compatible endpointtext, source_lang, target_lang; translated text is in data
GET/healthHealth checkReturns service status
GET/metricsAI Pod usage statisticsReturns counters in Prometheus text format

The upstream route definitions and endpoint field definitions can be used to check request formats. /metrics is an additional endpoint provided by the current AI Pod deployment.

Single and Batch Translation ​

Single Translation ​

Request POST /translate:

json
{
  "text": "你好,世界。",
  "from": "zh",
  "to": "en"
}

Actual response:

json
{
  "text": "Hello, world.",
  "from": "zh",
  "to": "en",
  "result": "Hello, world."
}
FieldRequiredDescription
textYesA string, or an array of strings for batch translation
fromNoSource language code; detected automatically when omitted or set to auto
toYesTarget language code, such as en, zh, ja

The response's text already contains the translation. The current deployment also returns result with the same content as text; the native upstream response only defines text, from, and to.

Batch Translation ​

Use POST /translate again, with text set to an array:

json
{
  "text": ["Hello, world!", "Good morning!"],
  "from": "en",
  "to": "zh"
}

Actual response:

json
{
  "text": ["你好,世界!", "早上好!"],
  "from": "en",
  "to": "zh",
  "result": ["你好,世界!", "早上好!"]
}

A batch uses the same source and target languages for all texts, and the returned array follows the input order. Automatic detection uses the first text to determine the source language, so do not mix source languages in one batch. The current service has no separate /translate/batch route. Batch language handling

Language Detection ​

Request POST /detect:

json
{
  "text": "Hello, world!"
}

Actual response:

json
{
  "language": "en"
}

This endpoint returns a language code without translating. If the source language is known, you can specify it directly in the translation request.

Compatible Endpoints for Browser Translation Extensions ​

These endpoints use the same translation models, with request and response structures adapted to different clients.

Immersive Translate ​

Request POST /imme:

json
{
  "source_lang": "en",
  "target_lang": "zh",
  "text_list": ["Hello, world!", "Good morning!"]
}

Actual response:

json
{
  "translations": [
    {"detected_source_lang": "en", "text": "你好,世界!"},
    {"detected_source_lang": "en", "text": "早上好!"}
  ]
}

source_lang can be omitted or set to auto. Texts in text_list should use the same source language.

Kiss Translator ​

Request POST /kiss:

json
{
  "text": "Hello, world!",
  "from": "en",
  "to": "zh"
}

Actual response:

json
{
  "text": "你好,世界!",
  "from": "en",
  "to": "zh"
}

This endpoint takes a single string for text.

Selection Translate ​

Request POST /hcfy:

json
{
  "text": "Hello, world!",
  "source": "英语",
  "destination": ["中文(简体)"]
}

Actual response:

json
{
  "text": "Hello, world!",
  "from": "英语",
  "to": "中文(简体)",
  "result": ["你好,世界!"]
}

Here, text retains the original text, while the translation is in result. Upstream maps Chinese language names to the codes for Chinese, English, and Japanese; other languages can use their codes directly. The destination array selects one target language and does not imply that the response contains translations into multiple target languages.

DeepLX ​

Request POST /deeplx:

json
{
  "text": "Hello, world!",
  "source_lang": "EN",
  "target_lang": "ZH"
}

The verified response structure is shown below; id varies with each request:

json
{
  "code": 200,
  "id": 1791789009008,
  "data": "你好,世界!",
  "alternatives": [],
  "source_lang": "EN",
  "target_lang": "ZH",
  "method": "Free"
}

Health Check and Usage Statistics ​

Request GET /health; the actual response is:

json
{
  "status": "ok"
}

This response does not include the loading status of individual language pairs. To confirm that a translation direction is available, send a translation request for that direction.

Request GET /metrics to return the following counters; their values change as requests are made:

text
# TYPE aipod:prompt_tokens_total counter
aipod:prompt_tokens_total 48
# TYPE aipod:generation_tokens_total counter
aipod:generation_tokens_total 46
# TYPE aipod:requests_total counter
aipod:requests_total 10

These are cumulative counters for the current deployment. They do not establish that tokens are counted in the same way as for OpenAI models.

Model Language Coverage ​

The model repository contains 93 directional language pairs covering 51 languages: 43 languages support translation both to and from English, for 86 directions in total, plus 7 one-way models translating into English. The number of model resource directories does not mean that all directions have been verified on the current service.

All direct models have English as either the source or target language. Translation between other languages can use English as an intermediate language, provided that both models are loaded. For example, Chinese to French uses zh → en → fr; this direction was tested successfully. Pivot inference implementation

43 Languages with Translation Both to and from English ​

Language CodeLanguage Name
arArabic
azAzerbaijani
bgBulgarian
bnBengali
caCatalan
csCzech
daDanish
deGerman
elGreek
esSpanish
etEstonian
faPersian
fiFinnish
frFrench
guGujarati
heHebrew
hiHindi
hrCroatian
huHungarian
idIndonesian
isIcelandic
itItalian
jaJapanese
knKannada
koKorean
ltLithuanian
lvLatvian
mlMalayalam
msMalay
nlDutch
plPolish
ptPortuguese
roRomanian
ruRussian
skSlovak
slSlovenian
sqAlbanian
svSwedish
taTamil
teTelugu
trTurkish
ukUkrainian
zhChinese

The code for English is en. Icelandic includes both English to Icelandic and Icelandic to English directions.

7 Languages with Models Only for Translation into English ​

Language CodeLanguage Name
beBelarusian
bsBosnian
mtMaltese
nbNorwegian (Bokmål)
nnNorwegian (Nynorsk)
srSerbian
viVietnamese

These 7 languages can be used as source languages and translated through English into other languages that have an English-to-target model. The current model collection does not support them as target languages for translation from other languages.

Simplified and Traditional Chinese Tags ​

Language codes use ISO 639-1. The current service normalizes codes with region or script suffixes to their primary language code; for example, both zh-Hans and zh-Hant are treated as zh.

Tests with zh-Hant as the target language still returned Simplified Chinese. This parameter cannot be used to request Traditional Chinese output.

Authentication and Errors ​

The service used for this verification accepted requests without authentication information. Upstream supports configuring authentication through API_KEY. When enabled, use the Authorization: Bearer YOUR_API_KEY request header or the ?token=YOUR_API_KEY query parameter; /health does not require authentication.

Unsupported translation directions return 400. The verified response for English to Belarusian was:

json
{
  "error": "Translation from 'en' to 'be' is not supported"
}

The following paths return 404 on the current deployment: /, /docs, /docs/index.html, /openapi.json, /version, /languages, /models, /v1/models, /translate/batch, /v1/chat/completions. A 404 on the home page does not mean that the service is unavailable; use /health and translation requests to verify it.

Standalone Usage ​

Use the API directly through an HTTP client on a computer that can access the service. The examples below use the LAN address from this verification; to use the AI Pod domain, simply replace the base address.

Command Line ​

bash
curl --fail-with-body --connect-timeout 5 --max-time 60 \
  'http://192.168.1.224:18126/translate' \
  -H 'Content-Type: application/json' \
  --data '{"text":"Hello, world!","from":"en","to":"zh"}'

Python ​

The following example sends a request using the Python standard library, with no additional dependencies to install:

python
import json
from urllib.request import Request, urlopen

base_url = "http://192.168.1.224:18126"
payload = {
    "text": ["Hello, world!", "Good morning!"],
    "from": "en",
    "to": "zh",
}
request = Request(
    f"{base_url}/translate",
    data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),
    headers={"Content-Type": "application/json"},
    method="POST",
)
with urlopen(request, timeout=60) as response:
    result = json.load(response)
print(result["text"])