{"openapi":"3.1.0","info":{"title":"Sublingo Unofficial Anime Subtitle Translator API","version":"1.0.0","description":"REST API wrapper for https://sublingo.cc/tools/anime-subtitle-translator built with Node.js, Hono, and OpenAPI 3.1. Supports auto-detect, SRT/VTT/ASS subtitle parsing, and HTTP/HTTPS/SOCKS5 residential proxy rotation."},"components":{"schemas":{"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"proxyPoolSize":{"type":"integer"},"proxies":{"type":"array","items":{"type":"object","properties":{"proxy":{"type":"string"},"coolingDown":{"type":"boolean"}},"required":["proxy","coolingDown"]}}},"required":["status","proxyPoolSize","proxies"]},"LanguagesResponse":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"}},"required":["name","code"]}}},"required":["languages"]},"TranslateLinesResponse":{"type":"object","properties":{"translated":{"type":"array","items":{"type":"string"},"example":["Selamat pagi, semuanya!","Apakah kamu siap untuk latihan?"]},"meta":{"type":"object","properties":{"lines":{"type":"integer"},"batches":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"retries":{"type":"integer"},"proxiesUsed":{"type":"array","items":{"type":"string"}}},"required":["lines","batches","from","to","retries","proxiesUsed"]}},"required":["translated","meta"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]},"GlossaryEntry":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":80,"example":"Nakama"},"target":{"type":"string","maxLength":80,"example":"Rekan"}},"required":["source","target"]},"TranslateLinesRequest":{"type":"object","properties":{"texts":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2000,"description":"Array of dialogue lines to translate. Automatically batched in chunks of 30.","example":["Good morning, everyone!","Are you ready for training?"]},"from":{"type":"string","minLength":1,"default":"auto","description":"Source language name or \"auto\" for auto-detect (e.g., \"auto\", \"English\", \"Japanese\").","example":"auto"},"to":{"type":"string","minLength":1,"default":"Indonesian","description":"Target language name (e.g., \"Indonesian\", \"English\", \"Japanese\").","example":"Indonesian"},"glossary":{"type":"array","items":{"$ref":"#/components/schemas/GlossaryEntry"},"maxItems":200,"description":"Optional glossary terms (max 20 for free quota, 200 for paid key)."},"proxy":{"type":"string","format":"uri","description":"Optional per-request proxy URL (supports auto-rotating residential proxies). Overrides PROXY_URL/PROXY_LIST.","example":"http://user:pass@residential-proxy.example.com:8000"},"sublingoKey":{"type":"string","description":"Optional Sublingo credit key (x-sublingo-key)."}},"required":["texts"]},"TranslateSubtitleResponse":{"type":"object","properties":{"format":{"type":"string","enum":["srt","vtt","ass"]},"content":{"type":"string","description":"Translated subtitle file content with preserved timestamps and formatting."},"meta":{"type":"object","properties":{"cues":{"type":"integer"},"batches":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"mode":{"type":"string","enum":["replace","original-first","translation-first"]},"retries":{"type":"integer"},"proxiesUsed":{"type":"array","items":{"type":"string"}}},"required":["cues","batches","from","to","mode","retries","proxiesUsed"]}},"required":["format","content","meta"]},"TranslateSubtitleRequest":{"type":"object","properties":{"content":{"type":"string","minLength":1,"description":"Raw subtitle file content (.srt, .vtt, or .ass/.ssa).","example":"1\n00:00:01,000 --> 00:00:04,000\nGood morning, everyone!\n"},"format":{"type":"string","enum":["auto","srt","vtt","ass"],"default":"auto","description":"Subtitle format. Defaults to \"auto\" (detected from content or filename).","example":"auto"},"filename":{"type":"string","description":"Optional original filename to aid format detection (e.g. \"episode01.ass\").","example":"episode01.srt"},"from":{"type":"string","minLength":1,"default":"auto","description":"Source language name or \"auto\" for auto-detect.","example":"auto"},"to":{"type":"string","minLength":1,"default":"Indonesian","description":"Target language name.","example":"Indonesian"},"mode":{"type":"string","enum":["replace","original-first","translation-first"],"default":"replace","description":"Output mode: replace original text, or merge bilingual.","example":"replace"},"glossary":{"type":"array","items":{"$ref":"#/components/schemas/GlossaryEntry"},"maxItems":200},"proxy":{"type":"string","format":"uri","description":"Optional per-request proxy URL (supports auto-rotating residential proxies). Overrides PROXY_URL/PROXY_LIST.","example":"http://user:pass@residential-proxy.example.com:8000"},"sublingoKey":{"type":"string"}},"required":["content"]}},"parameters":{}},"paths":{"/health":{"get":{"tags":["System"],"summary":"Health check and proxy pool status","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/languages":{"get":{"tags":["Metadata"],"summary":"List supported languages","description":"Returns all source/target languages supported by Sublingo, including Auto-detect.","responses":{"200":{"description":"List of supported languages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesResponse"}}}}}}},"/api/translate":{"post":{"tags":["Translation"],"summary":"Translate an array of dialogue lines","description":"Translates an array of strings using Sublingo. Automatically batches into chunks of 30 lines, supports auto-detect (\"auto\") or explicit source languages, and supports HTTP/HTTPS/SOCKS5 proxies (including auto-rotating residential proxies).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateLinesRequest"}}}},"responses":{"200":{"description":"Translated lines","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateLinesResponse"}}}},"429":{"description":"Daily free quota reached or credits empty after proxy retries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream Sublingo or proxy error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/translate/subtitle":{"post":{"tags":["Translation"],"summary":"Translate a full SRT, VTT, or ASS/SSA subtitle file","description":"Parses subtitle cues, translates dialogue lines in batches of 30 with proxy rotation, and reconstructs the subtitle file while preserving timestamps and ASS styling.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateSubtitleRequest"}}}},"responses":{"200":{"description":"Translated subtitle content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateSubtitleResponse"}}}},"400":{"description":"No translatable subtitle cues found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Daily free quota reached or credits empty after proxy retries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream Sublingo or proxy error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}