{"info":{"name":"NTS · TTS / STT / Translation","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json","description":"TTS/STT/Dịch dùng web_api_key tại Tài khoản qua Authorization: Bearer. Hai loại key không thay thế nhau. Domain cũ tiếp tục hoạt động; chuyển sang domain mới chỉ thay hostname, giữ đường dẫn, key và nội dung. Gói, Credit ngày, cache và thu phí giữ cơ chế cũ: TTS theo ký tự từng dòng, STT làm tròn lên phút (tối thiểu 1), Dịch theo ký tự bản dịch. Phần đã xử lý có thể được thu phí khi tác vụ lỗi hoặc dừng. Hạn mức USD của API Model không áp dụng. POST tạo dự án cũ không có bảo đảm Idempotency-Key; khi mất phản hồi không tự gửi lại POST."},"variable":[{"key":"legacy_base","value":"https://api.ntsgenai.com/api/v1/public-api"},{"key":"web_api_key","value":"YOUR_WEB_API_KEY"}],"item":[{"name":"TTS / STT / Translation","item":[{"name":"Lấy số dư credit","request":{"method":"GET","description":"web_api_key · /account\n\nTrả về số dư credit hiện tại (base_balance + daily_balance), credit miễn phí trong ngày, gói trả phí đang còn hạn và hạng VIP.\n\n","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/balance"},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"credit_balance\": 105000,\n    \"base_balance\": 100000,\n    \"daily_balance\": 5000,\n    \"free_daily_credit\": 5000,\n    \"free_chars_used\": 0,\n    \"free_daily_char_limit\": 1000000,\n    \"plans\": [\n      {\n        \"plan_id\": \"pro\",\n        \"name\": \"Chuyên nghiệp\",\n        \"daily_allowance\": 100000,\n        \"expires_at\": \"2026-07-23 00:00:00\"\n      }\n    ],\n    \"vip\": {\n      \"tier\": 1,\n      \"name\": \"Đồng\"\n    }\n  }\n}"}]},{"name":"Danh sách giọng","request":{"method":"GET","description":"web_api_key · /account\n\nDanh sách giọng đọc (phân trang + lọc). Mỗi giọng có `voice_id` là chuỗi opaque, dùng trực tiếp cho `voices[].voice_id` ở endpoint tạo TTS.\n\nlanguage (query, string): Mã ngôn ngữ BCP-47 (vd `vi-VN`, `en-US`).\ngender (query, string): `male` hoặc `female`.\ntier (query, string): `free` / `standard` / `professional` / `professional_clone`.\nsearch (query, string): Tìm theo tên hoặc mô tả giọng.\nsort (query, string): `popular` (mặc định) / `least` / `name`.\noffset (query, number): Bỏ qua N kết quả đầu.\nlimit (query, number): Số kết quả tối đa (mặc định 20).","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/voices?language=vi-VN&sort=popular&offset=0&limit=20"},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": [\n    {\n      \"voice_id\": \"6748abc1234567890def0123\",\n      \"name\": \"Hoài My\",\n      \"language\": \"vi-VN\",\n      \"gender\": \"female\",\n      \"tier\": \"standard\",\n      \"price_base\": 1\n    }\n  ],\n  \"total\": 100,\n  \"has_more\": true\n}"}]},{"name":"Tạo dự án TTS","request":{"method":"POST","description":"web_api_key · /account\n\nTạo dự án text-to-speech rồi START luôn (giới hạn luồng y hệt giao diện web). Trả về `project_id` + `req_id` để theo dõi. Dự án sẽ hiện trên trang `/tts` của tài khoản.\n\nname (body, string, required): Tên dự án (hiển thị trên web).\nsource_type (body, string): `text` | `srt` | `vtt` | `ass` (mặc định `text`).\nhas_timing (body, boolean): `true` nếu có dấu thời gian (SRT/VTT/ASS).\nlines (body, array, required): Mảng dòng: `[{ text, vocal_no }]` — `vocal_no` map sang `voices`.\nvoices (body, array, required): Mảng giọng: `[{ vocal_no, voice_id }]` — `voice_id` lấy từ `/voices`.","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[{"key":"Content-Type","value":"application/json"}],"url":"{{legacy_base}}/tts","body":{"mode":"raw","raw":"{\n  \"name\": \"My TTS project\",\n  \"source_type\": \"text\",\n  \"has_timing\": false,\n  \"lines\": [\n    {\n      \"text\": \"Xin chào, đây là bản test của API.\",\n      \"vocal_no\": 1\n    }\n  ],\n  \"voices\": [\n    {\n      \"vocal_no\": 1,\n      \"voice_id\": \"6748abc1234567890def0123\"\n    }\n  ]\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"project_id\": \"abc123def456789...\",\n    \"req_id\": \"fedcba987654321...\",\n    \"status\": \"pending\",\n    \"cost\": 30\n  }\n}"}]},{"name":"Lấy kết quả","request":{"method":"GET","description":"web_api_key · /account\n\nPoll trạng thái dự án. Khi `status` = `done`, `audio_url` là URL file âm thanh (presigned 48 giờ); `srt_url` là file phụ đề (nếu có).\n\nproject_id (path, string, required): ID dự án (trả về từ `POST /tts`).","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/tts/abc123def456789..."},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"project_id\": \"abc123def456789...\",\n    \"name\": \"My TTS project\",\n    \"status\": \"done\",\n    \"progress\": 100,\n    \"audio_url\": \"https://cdn.example.com/tts/user/abc.mp3?...\",\n    \"srt_url\": \"\",\n    \"queue_position\": null,\n    \"created_at\": \"2026-06-23 10:00:00\",\n    \"updated_at\": \"2026-06-23 10:02:30\"\n  }\n}"}]},{"name":"Danh sách model STT","request":{"method":"GET","description":"web_api_key · /account\n\nDanh sách model nhận dạng giọng nói (Speech-to-Text). Mỗi model có `model_id` (dùng khi tạo dự án) và `credit_per_minute` (tỷ lệ trừ credit theo số phút audio).\n\n","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/stt/models"},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": [\n    {\n      \"model_id\": \"whisper-standard\",\n      \"name\": \"Whisper Standard\",\n      \"credit_per_minute\": 100,\n      \"description\": \"Nhận dạng giọng nói đa ngôn ngữ, có timestamp theo từ.\"\n    }\n  ]\n}"}]},{"name":"Tạo dự án STT (nhận dạng)","request":{"method":"POST","description":"web_api_key · /account\n\nTạo dự án nhận dạng giọng nói rồi START luôn (giới hạn 2 luồng như web). Gửi dạng `multipart/form-data` hoặc `application/x-www-form-urlencoded`: hoặc `url_file` (link video/audio công khai) HOẶC tải lên `file` (multipart). Trả `project_id` + `req_id` để poll. Trừ credit theo PHÚT khi worker xử lý xong. Dự án hiện trên trang `/stt` của tài khoản.\n\nmodel_id (body, string, required): ID model STT (lấy từ `/stt/models`).\nurl_file (body, string): Link video/audio công khai (YouTube/TikTok/link file trực tiếp). Bỏ trống nếu tải `file`.\nfile (body, string): File video/audio (multipart/form-data). Dùng khi KHÔNG có `url_file`.\nlanguage (body, string): Mã ngôn ngữ nói (vd `vi`, `en`). Bỏ trống = tự động nhận diện.\nname (body, string): Tên dự án (hiển thị trên /stt).","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"url":"{{legacy_base}}/stt/transcribe","body":{"mode":"urlencoded","urlencoded":[{"key":"model_id","value":"whisper-standard","type":"text"},{"key":"url_file","value":"https://example.com/audio.mp3","type":"text"},{"key":"language","value":"","type":"text"},{"key":"name","value":"My transcription","type":"text"}]}},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"project_id\": \"abc123def456789...\",\n    \"req_id\": \"fedcba987654321...\",\n    \"status\": \"pending\"\n  }\n}"}]},{"name":"Lấy kết quả STT","request":{"method":"GET","description":"web_api_key · /account\n\nPoll trạng thái dự án STT. Khi `status` = `done`, `transcript_url` là URL file JSON kết quả (chuẩn Whisper: `segments` + `words`, presigned 48 giờ). Tải URL đó để lấy nội dung phụ đề; xuất txt/srt/vtt/ass tự thực hiện phía bạn.\n\nproject_id (path, string, required): ID dự án (trả về từ `POST /stt/transcribe`).","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/stt/abc123def456789..."},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"project_id\": \"abc123def456789...\",\n    \"name\": \"My transcription\",\n    \"status\": \"done\",\n    \"progress\": 100,\n    \"duration_seconds\": 184.5,\n    \"segment_count\": 42,\n    \"language\": \"vi\",\n    \"transcript_url\": \"https://cdn.example.com/stt/user/abc.json?...\",\n    \"queue_position\": null,\n    \"created_at\": \"2026-06-26 10:00:00\",\n    \"updated_at\": \"2026-06-26 10:03:10\"\n  }\n}"}]},{"name":"Danh sách model dịch","request":{"method":"GET","description":"web_api_key · /account\n\nDanh sách model dịch phụ đề + danh sách ngôn ngữ đích hỗ trợ. Mỗi model có `model_id` (dùng khi tạo dự án) và `price_base` (tỷ lệ trừ credit / ký tự bản dịch). `languages` là tên ngôn ngữ đích hợp lệ cho `target_lang`.\n\n","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/translate/models"},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"models\": [\n      {\n        \"model_id\": \"context-10\",\n        \"name\": \"Ngữ cảnh phim 10\",\n        \"price_base\": 10,\n        \"description\": \"Dịch theo ngữ cảnh, chất lượng phim.\"\n      }\n    ],\n    \"languages\": [\n      \"Vietnamese\",\n      \"English\",\n      \"Japanese\",\n      \"Korean\"\n    ]\n  }\n}"}]},{"name":"Tạo dự án dịch phụ đề","request":{"method":"POST","description":"web_api_key · /account\n\nGửi NỘI DUNG phụ đề định dạng SRT (`content`) rồi START luôn (giới hạn luồng + hàng đợi như web). Trả `project_id` + `req_id` để poll. Trừ credit theo số ký tự BẢN DỊCH khi xong. Dự án hiện trên trang `/translate` của tài khoản. `detect_mode`: `none` (không nhận dạng người nói) / `gender` (Nam–Nữ) / `multi` (nhiều người nói).\n\ncontent (body, string, required): Nội dung phụ đề SRT (raw text — gồm số thứ tự, mốc thời gian, văn bản).\ntarget_lang (body, string, required): Tên ngôn ngữ đích (PHẢI thuộc `languages` của `/translate/models`).\nmodel_id (body, string, required): ID model dịch (lấy từ `/translate/models`).\nsource_lang (body, string): Tên ngôn ngữ nguồn. Bỏ trống = để engine tự nhận.\ndetect_mode (body, string): `none` (mặc định) / `gender` / `multi` — nhận dạng người nói.\nname (body, string): Tên dự án (hiển thị trên /translate).","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[{"key":"Content-Type","value":"application/json"}],"url":"{{legacy_base}}/translate/subtitle","body":{"mode":"raw","raw":"{\n  \"content\": \"1\\n00:00:01,000 --> 00:00:02,500\\nHello world\\n\\n2\\n00:00:03,000 --> 00:00:04,000\\nHow are you?\",\n  \"target_lang\": \"Vietnamese\",\n  \"model_id\": \"context-10\",\n  \"source_lang\": \"English\",\n  \"detect_mode\": \"none\",\n  \"name\": \"My translation\"\n}","options":{"raw":{"language":"json"}}}},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"project_id\": \"abc123def456789...\",\n    \"req_id\": \"fedcba987654321...\",\n    \"status\": \"pending\"\n  }\n}"}]},{"name":"Lấy kết quả dịch","request":{"method":"GET","description":"web_api_key · /account\n\nPoll trạng thái dự án dịch. Mảng `lines` cập nhật dần: mỗi dòng có `text` (gốc), `translate_text` (bản dịch), `vocal` (số người nói khi `detect_mode` ≠ `none`). Khi `status` = `done` là dịch xong; bạn tự dựng SRT/VTT/ASS/JSON từ `lines`.\n\nproject_id (path, string, required): ID dự án (trả về từ `POST /translate/subtitle`).","auth":{"type":"bearer","bearer":[{"key":"token","value":"{{web_api_key}}","type":"string"}]},"header":[],"url":"{{legacy_base}}/translate/abc123def456789..."},"response":[{"name":"Example","status":"OK","code":200,"header":[{"key":"Content-Type","value":"application/json"}],"body":"{\n  \"success\": true,\n  \"data\": {\n    \"project_id\": \"abc123def456789...\",\n    \"name\": \"My translation\",\n    \"status\": \"done\",\n    \"progress\": 100,\n    \"source_lang\": \"English\",\n    \"target_lang\": \"Vietnamese\",\n    \"detect_mode\": \"none\",\n    \"segment_count\": 2,\n    \"translated_lines\": 2,\n    \"lines\": [\n      {\n        \"line_no\": 1,\n        \"start_time\": \"00:00:01,000\",\n        \"end_time\": \"00:00:02,500\",\n        \"text\": \"Hello world\",\n        \"translate_text\": \"Xin chào thế giới\",\n        \"vocal\": 0\n      }\n    ],\n    \"queue_position\": null,\n    \"created_at\": \"2026-06-29 10:00:00\",\n    \"updated_at\": \"2026-06-29 10:01:20\"\n  }\n}"}]}]}]}