API Documentation

Translate subtitles via HTTP API

Base URL: https://subtitle.netq.me
Auth: None (public API)
Rate Limit: Cloudflare Worker limits apply

Endpoints

GET /api/health GET /api/providers POST /api/translate POST /api/upload 🌐 Supported Languages
GET/api/health

Health check endpoint. Returns OK if the service is running.

200 OK
Response
{"ok": 1}
cURL
curl https://subtitle.netq.me/api/health
GET/api/providers

List available AI translation providers and the currently active one.

200 OK
Response
{
  "active": "mistral",
  "providers": [
    {"name": "mistral", "model": "mistral-small-latest"},
    {"name": "atom", "model": "cipher"}
  ]
}
POST/api/translate

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.

Request Body — JSON
FieldTypeRequiredDescription
contentstringrequiredRaw SRT subtitle content
targetLangstringrequiredTarget language code (e.g. id, ja, ko)
sourceLangstringoptionalSource language code. Default: en. Use auto for auto-detection.
providerstringoptionalAI provider name. Default: active provider.
Request Example
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"
  }'
200 OK — Success
Response
{
  "success": true,
  "provider": "mistral",
  "totalLines": 1,
  "chunks": 1,
  "result": "1
00:00:01,000 --> 00:00:03,000
Halo dunia
"
}
400 Bad Request
Response
{"error": "content and targetLang are required"}
POST/api/upload

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.

Request Body — multipart/form-data
FieldTypeRequiredDescription
fileFilerequiredSubtitle file (SRT/ASS/SSA/VTT/SUB/LRC/TXT)
targetLangstringrequiredTarget language code
sourceLangstringoptionalSource language code. Default: en. Use auto for auto-detection.
providerstringoptionalAI provider name
cURL Example
curl -X POST https://subtitle.netq.me/api/upload   -F "file=@subtitle.srt"   -F "targetLang=id"   -F "sourceLang=en"
Python Example
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
JavaScript Example
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
200 OK — Success
Response
{
  "success": true,
  "provider": "mistral",
  "totalLines": 200,
  "chunks": 10,
  "filename": "subtitle.id.srt",
  "result": "1
00:00:01,000 --> 00:00:03,000
Halo dunia

..."
}
400 Bad Request — Error Cases
Possible Responses
{"error": "file and targetLang are required"}
{"error": "File is empty"}
{"error": "No valid subtitle entries found"}
🌐 Supported Languages

40 languages supported. Pass the language code to targetLang or sourceLang.

🇬🇧 en English
🇮🇩 id Indonesian
🇯🇵 ja Japanese
🇰🇷 ko Korean
🇨🇳 zh Chinese Simplified
🇹🇼 zh_tw Chinese Traditional
🇹🇭 th Thai
🇻🇳 vi Vietnamese
🇸🇦 ar Arabic
🇲🇾 ms Malay
🇫🇷 fr French
🇩🇪 de German
🇪🇸 es Spanish
🇧🇷 pt Portuguese
🇷🇺 ru Russian
🇹🇷 tr Turkish
🇮🇳 hi Hindi
🇸🇪 sv Swedish
🇵🇱 pl Polish
🇳🇱 nl Dutch
🇮🇹 it Italian
🇨🇿 cs Czech
🇭🇷 hr Croatian
🇮🇱 he Hebrew
🇭🇺 hu Hungarian
🇷🇴 ro Romanian
🇧🇬 bg Bulgarian
🇬🇷 el Greek
🇩🇰 da Danish
🇳🇴 no Norwegian
🇫🇮 fi Finnish
🇵🇭 fil Filipino
🇺🇦 uk Ukrainian
🇧🇩 bn Bengali
🇵🇰 ur Urdu
🇷🇸 sr Serbian
🇸🇰 sk Slovak
🇮🇩 su Sundanese
🇮🇷 fa Persian
🇰🇪 sw Swahili
Use auto as sourceLang to auto-detect the source language.