Hệ thống tạo Video, Ảnh, Giọng nói AI tự động 24/7

Tài liệu API

tts

Giọng đọc CapCut Đa Ngôn Ngữ — Chuyển đổi văn bản thành giọng đọc AI truyền cảm, ngắt nghỉ tự nhiên chuẩn phòng thu bằng Giọng đọc CapCut Đa Ngôn Ngữ.

SV3 (sv3) · healthyid: ttstype: giong-noi-aioutput: audio100đ / 1.000 ký tự

Máy chủ SV3 hiện có nhiều gói sản phẩm khác nhau thuộc cùng dòng tts. Để chạy chính xác 100% đúng gói này, hãy truyền thẳng mã gói "model": "tts" kèm "server": "sv3".

Các gói & Server (SV) hiện có của model ttsGET /api/v1/models/tts/servers

Bảng giá API chi tiết theo từng cấu hình tham số

Đơn giá thực tế (VNĐ) trừ vào ví khi gọi POST /v1/generations (hoặc kiểm tra trước qua POST /v1/generations/estimate).

100đ / 1.000 ký tự
Mọi giọng đọc:100đ / 1.000 ký tự

Input — tham số đầu vào

POST/v1/generations

Gửi JSON theo cấu trúc chuẩn "model": "tts", "server": "sv3" và các tham số dưới đây ở cùng cấp. Tham số không có trong bảng sẽ bị từ chối (400).

Tham sốKiểuGiá trị hỗ trợMô tả
modelrequiredstringttsMã gói sản phẩm duy nhất (khuyến nghị truyền đúng mã này để chốt chính xác gói trên SV).
serverstringsv3autoChốt máy chủ SV chạy đơn (cũng nhận alias server_id) hoặc auto để tự chọn SV healthy giá tốt nhất. Kiểm tra SV sống qua GET /v1/models/tts/servers.
voicerequiredenum
BV421_vivn_streamingvi_female_huongvi-VN-HoaiMyNeuralvi-VN-NamMinhNeuralBV562_streamingBV560_streamingBV074_streamingBV075_streamingBV074_streaming_dspBV075_streaming_vibrato_dspBV075_streaming_demon_dspBV075_streaming_robot_dspICL_en_male_henry1ICL_en_female_ericaICL_en_male_attenboroughICL_en_male_cumberbatch2ICL_en_male_terrellICL_en_male_cc_rafaelICL_en_male_alastorICL_en_male_severusICL_en_female_cmICL_en_male_grinch2ICL_en_male_kevin2ICL_en_male_conductor1ICL_en_male_oogie2ICL_en_male_frosty1ICL_en_male_zayneICL_en_male_xavier1ICL_en_male_sylusICL_en_female_chamberlainICL_en_male_cumberbatch1ICL_en_female_blanchettICL_en_male_henry2ICL_en_male_benjamin1ICL_en_male_benjamin2ICL_en_male_cc_lichICL_en_male_cc_draculaICL_en_female_cc_bluetoothICL_en_male_cc_pennyICL_en_female_cc_meganICL_en_male_cc_jigsawICL_en_male_cc_chuckyICL_en_male_cc_ghostface4ICL_en_male_aussieICL_en_male_poetryICL_2206985c8bf6ICL_en_female_guanggaoICL_en_female_jiaoaoICL_en_male_matthewBV516_streamingBV504_streamingBV503_streamingBV502_streamingBV027_streamingBV510_streamingBV138_streamingBV127_streamingBV505_streamingBV031_streamingICL_en_male_callumICL_en_male_drywICL_en_male_georgeBV506_streamingBV507_streamingBV072_streamingBV192_streamingBV191_streamingBV540_streamingBV190_streamingBV164_streamingBV162_streamingBV161_streamingBV160_streamingICL_id_male_uncle_hendraICL_id_female_grandma_sitiICL_id_female_hantuperempuanBV541_streamingICL_id_female_jannah_happyICL_id_male_sadICL_id_male_scaredICL_id_male_grandpa_sumarnoICL_id_male_boy_budiICL_id_female_girl_dewiICL_id_female_sickweakICL_id_female_icecold_kartikaICL_es_male_barneyICL_es_male_elmoICL_es_female_dianpoICL_es_male_doradoICL_es_female_tt_MarianaFICL_es_male_tt_GerardoQICL_es_male_tt_JuanZICL_es_male_tt_JuanJICL_es_male_tt_JonnieVvICL_es_male_tt_EmanuelAICL_mx_female_tt_carolaICL_es_female_dianyingpeiyinICL_es_male_cixingICL_es_male_taiciBV062_streamingICL_es_female_tt_AzulBICL_es_male_tt_GerardoFCPICL_es_female_tt_RosaWICL_es_female_tt_ViviICL_br_male_208M_VitorC2ICL_br_female_217V_MichelleMICL_br_male_207M_RodrigoA2ICL_br_female_218F_GracianaCICL_br_male_201M_CaioSICL_br_male_206M_VitorC1ICL_br_male_210M_AlexNICL_br_male_204M_RodrigoA1BV531_streamingBV530_streamingICL_br_male_202M_EduardoSICL_ja_female_laopopoICL_jp_male_kenanICL_jp_female_tt_youICL_jp_female_jidongshaonvICL_ja_female_kuaizui02ICL_ja_female_shuanglangICL_ja_male_gaoxiaoICL_ja_male_gaoxiao02BV428_streamingBV701_streamingBV411_streamingBV007_streamingBV405_streamingBV408_streamingBV425_streamingBV145_streamingBV430_streamingBV021_streamingBV213_streamingBV144_streamingBV433_streamingBV409_streamingBV063_streamingBV050_streamingBV064_streamingBV567_streamingBV568_streamingBV078_streamingBV068_streamingBV570_streaming

Mặc định: BV421_vivn_streaming

Giọng đọc CapCut
textrequiredstring

Tối đa 5.000 ký tự

Văn bản
voice_2string

Tối đa 80 ký tự

Mã giọng khác (không bắt buộc) — Bỏ trống để dùng giọng đã chọn ở trên
speednumber

0.7 – 1.5

Mặc định: 1

Tốc độ — 0.7 = chậm, 1 = tự nhiên, 1.5 = nhanh
  • Tham số file (string URL) nhận link công khai http(s) — máy chủ tự tải về — hoặc URL trả về từ API tải file POST /account/ai/uploads.
  • Bỏ trống tham số không bắt buộc thì dùng giá trị mặc định. Có thể gửi thêm header Idempotency-Key để thử lại an toàn không trừ tiền 2 lần.

Ví dụ request (cURL)

curl -X POST https://topai.io.vn/api/v1/generations \
  -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
  -d '{
  "model": "tts",
  "server": "sv3",
  "voice": "BV421_vivn_streaming",
  "text": "Một chú mèo phi hành gia",
  "speed": 1
}'

Code mẫu tích hợp đầy đủ (Upload file → Tạo tác vụ → Nhận kết quả)

Python 3

import os, time, requests

BASE = "https://topai.io.vn/api"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}

r = requests.post(f"{BASE}/v1/generations", headers=HEADERS, json={
    "model": "tts",
    "server": "sv3",
    "voice": "BV421_vivn_streaming",
    "text": "Một chú mèo phi hành gia",
    "speed": 1
}, timeout=60)
gen = r.json()
if not r.ok:
    raise RuntimeError(gen.get("message") or r.text)

while gen.get("status") in ("queued", "processing"):
    time.sleep(5)
    gen = requests.get(f"{BASE}/v1/generations/{gen['id']}", headers=HEADERS, timeout=60).json()

if gen.get("status") != "succeeded":
    raise RuntimeError(gen.get("error") or gen.get("status"))
print("Kết quả:", gen["output"])

Node.js (18+)

const BASE = "https://topai.io.vn/api";
const headers = { "X-API-Key": process.env.API_KEY, "Content-Type": "application/json" };

const createRes = await fetch(`${BASE}/v1/generations`, {
  method: "POST",
  headers,
  body: JSON.stringify({
  "model": "tts",
  "server": "sv3",
  "voice": "BV421_vivn_streaming",
  "text": "Một chú mèo phi hành gia",
  "speed": 1
}),
});
let gen = await createRes.json();
if (!createRes.ok) throw new Error(gen.message || createRes.statusText);

while (["queued", "processing"].includes(gen.status)) {
  await new Promise((r) => setTimeout(r, 5000));
  gen = await fetch(`${BASE}/v1/generations/${gen.id}`, { headers }).then((r) => r.json());
}
if (gen.status !== "succeeded") throw new Error(gen.error ?? gen.status);
console.log("Kết quả:", gen.output);

Output — kết quả trả về

Tác vụ chạy bất đồng bộ. POST /v1/generations trả ngay đối tượng generation với status queued hoặc processing; hỏi lại GET /v1/generations/{id} mỗi 5–10 giây tới khi status là succeeded, failed hoặc cancelled.

GET/v1/generations/{id}
{
  "id": "3f1c...-uuid",
  "object": "generation",
  "code": "T8KQ2M4X",
  "model": "tts",
  "canonical_model": "tts",
  "server_id": "sv3",
  "server_name": "SV3",
  "status": "succeeded",       // queued | processing | succeeded | failed | cancelled
  "progress": 100,
  "cost": 2400,                // số tiền đã trừ
  "currency": "VND",
  "refunded": false,
  "output": {
    "type": "audio",
    "files": [{ "url": "https://topai.io.vn/uploads/ai/outputs/....mp3", "type": "audio", "name": "audio.mp3" }],
    "text": null
  },
  "error": null,
  "created_at": "2026-10-30T08:00:00.000Z",
  "completed_at": "2026-10-30T08:01:12.000Z"
}
TrườngÝ nghĩa
model / server_idĐúng mã gói sản phẩm và máy chủ SV đã thực thi tác vụ.
output.files[].urlLink file kết quả — nên tải về hệ thống của bạn, file trên máy chủ có thể được dọn sau một thời gian.
output.textNội dung văn bản (chỉ có với model trả văn bản).
costSố tiền VND đã trừ vào số dư; lỗi hoặc huỷ thì tự hoàn lại (refunded = true).
errorLý do lỗi khi status = failed.

Báo giá trước khi chạy

POST/v1/generations/estimate

Cùng body với POST /v1/generations, không chạy và không trừ tiền (tự áp % chiết khấu riêng nếu tài khoản có).

# => {
#   "object": "estimate",
#   "model": "tts",
#   "canonical_model": "tts",
#   "server_id": "sv3",
#   "server_name": "SV3",
#   "cost": 2400,
#   "currency": "VND"
# }
Lấy API key
tts · Tài liệu API | topai.io.vn