Translate subtitles via HTTP API
https://subtitle.netq.meHealth check endpoint. Returns OK if the service is running.
{"ok": 1}
curl https://subtitle.netq.me/api/health
List available AI translation providers and the currently active one.
{
"active": "mistral",
"providers": [
{"name": "mistral", "model": "mistral-small-latest"},
{"name": "atom", "model": "cipher"}
]
}
Translate subtitle text via JSON body. Pass raw SRT content as a string. The API automatically splits into chunks (20 lines each) and translates with up to 3 concurrent AI requests.
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | required | Raw SRT subtitle content |
| targetLang | string | required | Target language code (e.g. id, ja, ko) |
| sourceLang | string | optional | Source language code. Default: en. Use auto for auto-detection. |
| provider | string | optional | AI provider name. Default: active provider. |
curl -X POST https://subtitle.netq.me/api/translate -H "Content-Type: application/json" -d '{
"content": "1
00:00:01,000 --> 00:00:03,000
Hello world",
"targetLang": "id",
"sourceLang": "en"
}'
{
"success": true,
"provider": "mistral",
"totalLines": 1,
"chunks": 1,
"result": "1
00:00:01,000 --> 00:00:03,000
Halo dunia
"
}
{"error": "content and targetLang are required"}
Translate a subtitle file via multipart/form-data upload. Supports SRT, ASS, SSA, VTT, SUB, and LRC formats. Returns the translated SRT with a suggested filename.
| Field | Type | Required | Description |
|---|---|---|---|
| file | File | required | Subtitle file (SRT/ASS/SSA/VTT/SUB/LRC/TXT) |
| targetLang | string | required | Target language code |
| sourceLang | string | optional | Source language code. Default: en. Use auto for auto-detection. |
| provider | string | optional | AI provider name |
curl -X POST https://subtitle.netq.me/api/upload -F "file=@subtitle.srt" -F "targetLang=id" -F "sourceLang=en"
import requests
resp = requests.post(
"https://subtitle.netq.me/api/upload",
files={"file": open("subtitle.srt", "rb")},
data={"targetLang": "id", "sourceLang": "en"}
)
data = resp.json()
print(data["result"]) # translated SRT content
const form = new FormData();
form.append("file", fileBlob, "subtitle.srt");
form.append("targetLang", "id");
form.append("sourceLang", "en");
const resp = await fetch("/api/upload", {
method: "POST",
body: form,
});
const data = await resp.json();
console.log(data.result); // translated SRT
{
"success": true,
"provider": "mistral",
"totalLines": 200,
"chunks": 10,
"filename": "subtitle.id.srt",
"result": "1
00:00:01,000 --> 00:00:03,000
Halo dunia
..."
}
{"error": "file and targetLang are required"}
{"error": "File is empty"}
{"error": "No valid subtitle entries found"}
40 languages supported. Pass the language code to targetLang or sourceLang.
en Englishid Indonesianja Japaneseko Koreanzh Chinese Simplifiedzh_tw Chinese Traditionalth Thaivi Vietnamesear Arabicms Malayfr Frenchde Germanes Spanishpt Portugueseru Russiantr Turkishhi Hindisv Swedishpl Polishnl Dutchit Italiancs Czechhr Croatianhe Hebrewhu Hungarianro Romanianbg Bulgarianel Greekda Danishno Norwegianfi Finnishfil Filipinouk Ukrainianbn Bengaliur Urdusr Serbiansk Slovaksu Sundanesefa Persiansw Swahiliauto as sourceLang to auto-detect the source language.