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.
| Method | Path | Purpose | Main Request Fields or Response Content |
|---|---|---|---|
| POST | /translate | Single or batch translation | text, from, to; returns translated text and language codes |
| POST | /detect | Language detection | text; returns language |
| POST | /imme | Immersive Translate compatible endpoint | text_list, source_lang, target_lang; returns translations |
| POST | /kiss | Kiss Translator compatible endpoint | text, from, to; returns translated text and language codes |
| POST | /hcfy | Selection Translate compatible endpoint | text, source, destination; translated text is in the result array |
| POST | /deeplx | DeepLX compatible endpoint | text, source_lang, target_lang; translated text is in data |
| GET | /health | Health check | Returns service status |
| GET | /metrics | AI Pod usage statistics | Returns 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:
{
"text": "你好,世界。",
"from": "zh",
"to": "en"
}Actual response:
{
"text": "Hello, world.",
"from": "zh",
"to": "en",
"result": "Hello, world."
}| Field | Required | Description |
|---|---|---|
text | Yes | A string, or an array of strings for batch translation |
from | No | Source language code; detected automatically when omitted or set to auto |
to | Yes | Target 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:
{
"text": ["Hello, world!", "Good morning!"],
"from": "en",
"to": "zh"
}Actual response:
{
"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:
{
"text": "Hello, world!"
}Actual response:
{
"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:
{
"source_lang": "en",
"target_lang": "zh",
"text_list": ["Hello, world!", "Good morning!"]
}Actual response:
{
"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:
{
"text": "Hello, world!",
"from": "en",
"to": "zh"
}Actual response:
{
"text": "你好,世界!",
"from": "en",
"to": "zh"
}This endpoint takes a single string for text.
Selection Translate
Request POST /hcfy:
{
"text": "Hello, world!",
"source": "英语",
"destination": ["中文(简体)"]
}Actual response:
{
"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:
{
"text": "Hello, world!",
"source_lang": "EN",
"target_lang": "ZH"
}The verified response structure is shown below; id varies with each request:
{
"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:
{
"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:
# 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 10These 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 Code | Language Name |
|---|---|
| ar | Arabic |
| az | Azerbaijani |
| bg | Bulgarian |
| bn | Bengali |
| ca | Catalan |
| cs | Czech |
| da | Danish |
| de | German |
| el | Greek |
| es | Spanish |
| et | Estonian |
| fa | Persian |
| fi | Finnish |
| fr | French |
| gu | Gujarati |
| he | Hebrew |
| hi | Hindi |
| hr | Croatian |
| hu | Hungarian |
| id | Indonesian |
| is | Icelandic |
| it | Italian |
| ja | Japanese |
| kn | Kannada |
| ko | Korean |
| lt | Lithuanian |
| lv | Latvian |
| ml | Malayalam |
| ms | Malay |
| nl | Dutch |
| pl | Polish |
| pt | Portuguese |
| ro | Romanian |
| ru | Russian |
| sk | Slovak |
| sl | Slovenian |
| sq | Albanian |
| sv | Swedish |
| ta | Tamil |
| te | Telugu |
| tr | Turkish |
| uk | Ukrainian |
| zh | Chinese |
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 Code | Language Name |
|---|---|
| be | Belarusian |
| bs | Bosnian |
| mt | Maltese |
| nb | Norwegian (Bokmål) |
| nn | Norwegian (Nynorsk) |
| sr | Serbian |
| vi | Vietnamese |
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:
{
"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
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:
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"])