PromptFlow AI
API docs

tts

Text to speech — Convert text into expressive, studio-quality AI voiceover with natural pauses using Text-to-Speech — prompts up to 300.000 characters.

SV6 (sv6) · healthyid: tts-3canonical_model: ttstype: giong-noi-aioutput: audio368đ – 919đ / 1,000 chars
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).

368đ – 919đ / 1,000 chars
Standard Voices:368đ / 1,000 charsPremium & Cloned voice:919đ / 1,000 chars

Tính theo độ dài văn bản thực tế (giọng cao cấp & giọng nhân bản nhân hệ số ×2.5)

Input — request parameters

POST/v1/generations

Gửi JSON theo cấu trúc chuẩn "model": "tts", "server": "sv6" and the parameters below at the same level. Parameters not listed in the table are rejected (400).

ParameterTypeSupported valuesDescription
modelrequiredstringtts-3or ttsMã gói sản phẩm trực tiếp hoặc mã dòng model chuẩn (kết hợp cùng tham số chọn SV bên dưới).
serverstringsv6autoChố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
vi_male_adamvi_male_anhquan_1vi_male_duyonyx_1vi_hoangnam_storyvi_hoangnam_story_ipavi_male_ngocngan_ipavi_male_ngocngan_ipa_2vi_quynhanh_ipavi_female_quynh_anhvi_taman_phatvi_male_baotrung_1clone_b8f7f83b_anh_ki_t_1e615dclone_b8f7f83b_b_nh_ng__pro_59e323clone_b8f7f83b_ch__m_nh_7722abclone_b8f7f83b_david_pro_ea54e9clone_b8f7f83b_kim_v_n_64cb11clone_b8f7f83b_ph_t_ph_p_42d7beclone_b8f7f83b_ph_t_ph_p_2_0_17858fclone_b8f7f83b_rivew_phim_4bc2eeclone_b8f7f83b_rivew_phim_trung_bac91cclone_b8f7f83b_t_m_an_7b6232clone_b8f7f83b_th_nh_ph_m_277794clone_b8f7f83b_th_y_trang_25e7ffclone_b8f7f83b_thuy_trang_2_0_2db255clone_b8f7f83b_t__phan_b3eba7tl_female_fil_2en_male_dung_1tl_female_fil_1en_male_history_1en_female_kawaii_1en_male_review_1en_male_review_bau_1ja_female_doanh_1ko_female_sellyhan_1clone_b8f7f83b_adas_4dd8f2clone_b8f7f83b_anna_van_1a954cclone_b8f7f83b_documentary_a_c3b72eclone_b8f7f83b_duyxx_22c001clone_b8f7f83b_frieren_5355c3clone_b8f7f83b_frierenf_5_0_c32368clone_b8f7f83b_hauda_3e78d5clone_b8f7f83b_hyau_b119c1clone_b8f7f83b_hyuna_2336e0clone_b8f7f83b_lia_a1e09dclone_b8f7f83b_manhwa_fresh_5_0_6dc744clone_b8f7f83b_manhwa_fresh_6_0_11a349clone_b8f7f83b_mask_us_9d5c04clone_b8f7f83b_msea_63c733clone_b8f7f83b_old_man_53180fclone_b8f7f83b_otana_72cfc6clone_b8f7f83b_podcast_mrdung_5c8e70clone_b8f7f83b_ruysea_94fbb5clone_b8f7f83b_seui_9cddd5clone_b8f7f83b_thanh_chung_198dd0clone_b8f7f83b_th_nh_chung_2_0_343c8aclone_b8f7f83b_ti_ng___story_c36a8e

Default: vi_male_adam

AI Voice
textrequiredstring

Up to 300.000 characters

Văn bản cần chuyển thành giọng nói — Hỗ trợ tối đa 300.000 ký tự mỗi lượt. Nên dùng dấu chấm, dấu phẩy và xuống dòng rõ ràng để AI ngắt nhịp tự nhiên nhất.
languagerequiredenum
autovienzhesfrdejakoitptruarhibnidmsthtlnltrplsvdanofielhecshuro

Default: auto

Speech language
speedrequiredenum
0.750.91.01.11.251.51.752.0

Default: 1.0

Reading speed
pause_presetrequiredenum
defaultnaturalstoryfast

Default: default

Punctuation pause cadence
formatrequiredenum
mp3wav

Default: mp3

Audio output format
  • File parameters (string URL) accept a public http(s) link — the server downloads it — or a URL returned by the file upload API 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.

Sample request (cURL)

curl -X POST https://promptflow.web.id/api/v1/generations \
  -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
  -d '{
  "model": "tts",
  "server": "sv6",
  "voice": "vi_male_adam",
  "text": "An astronaut cat",
  "language": "auto",
  "speed": "1.0",
  "pause_preset": "default",
  "format": "mp3"
}'

Complete integration code sample (Upload file → Create job → Poll result)

Python 3

import os, time, requests

BASE = "https://promptflow.web.id/api"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}

r = requests.post(f"{BASE}/v1/generations", headers=HEADERS, json={
    "model": "tts",
    "server": "sv6",
    "voice": "vi_male_adam",
    "text": "An astronaut cat",
    "language": "auto",
    "speed": "1.0",
    "pause_preset": "default",
    "format": "mp3"
}, 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://promptflow.web.id/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": "sv6",
  "voice": "vi_male_adam",
  "text": "An astronaut cat",
  "language": "auto",
  "speed": "1.0",
  "pause_preset": "default",
  "format": "mp3"
}),
});
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 — response

Jobs run asynchronously. POST /v1/generations immediately returns a generation object with status queued or processing; poll GET /v1/generations/{id} every 5–10 seconds until status is succeeded, failed or cancelled.

GET/v1/generations/{id}
{
  "id": "3f1c...-uuid",
  "object": "generation",
  "code": "T8KQ2M4X",
  "model": "tts-3",
  "canonical_model": "tts",
  "server_id": "sv6",
  "server_name": "SV6",
  "status": "succeeded",       // queued | processing | succeeded | failed | cancelled
  "progress": 100,
  "cost": 2400,                // amount charged
  "currency": "VND",
  "refunded": false,
  "output": {
    "type": "audio",
    "files": [{ "url": "https://promptflow.web.id/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"
}
FieldMeaning
model / server_idĐúng mã gói sản phẩm và máy chủ SV đã thực thi tác vụ.
output.files[].urlResult file links — download them to your own system; files on our server may be cleaned up after some time.
output.textText content (only for models that return text).
costAmount in VND charged to your balance; refunded automatically on failure or cancellation (refunded = true).
errorError reason when status = failed.

Get a quote before running

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-3",
#   "canonical_model": "tts",
#   "server_id": "sv6",
#   "server_name": "SV6",
#   "cost": 2400,
#   "currency": "VND"
# }
Get an API key