Tài liệu API VietVoice

Đấu nối giọng đọc AI vào app/website của bạn. Base URL: https://vietvoice.click

1. Lấy API key

  1. Đăng ký tài khoản tại vietvoice.click và nạp credits.
  2. Vào Tài khoản → API Key → Tạo key mới. Key chỉ hiện 1 lần — lưu ngay.

2. Xác thực

Gửi key trong header của mọi request:

# Header bắt buộc Authorization: Bearer vv_xxxxxxxxxxxxxxxx

3. Tạo giọng đọc

POST /api/v1/speech
Tham sốKiểuMô tả
inputstring *Văn bản cần đọc (tối đa 20.000 credits)
voicestringTên giọng (mặc định: Hải Đăng). Xem /api/v1/voices
response_formatstringLuôn trả wav
curl https://vietvoice.click/api/v1/speech \ -H "Authorization: Bearer vv_..." \ -H "Content-Type: application/json" \ -d '{"input": "Xin chào các bạn!", "voice": "Hải Đăng"}' \ --output audio.wav import requests r = requests.post("https://vietvoice.click/api/v1/speech", headers={"Authorization": "Bearer vv_..."}, json={"input": "Xin chào!", "voice": "Hải Đăng"}) open("audio.wav", "wb").write(r.content)

✅ Thành công: HTTP 200, body là file WAV (48kHz).
💰 Trừ 1 credits / 1 credits văn bản — giống tạo trên web.

4. Danh sách giọng

GET /api/v1/voices
curl https://vietvoice.click/api/v1/voices \ -H "Authorization: Bearer vv_..."

5. Kiểm tra số dư

GET /api/auth/me

Trả về balance (số credits còn lại) và thông tin tài khoản.

6. Mã lỗi

MãÝ nghĩa
401Thiếu/sai API key
402Hết credits — nạp thêm trong Studio
429Engine đang bận — thử lại sau vài giây

7. Lưu ý

VietVoice API Documentation

Integrate AI voices into your app/website. Base URL: https://vietvoice.click

1. Get an API key

  1. Sign up at vietvoice.click and top up characters.
  2. Go to Account → API Keys → Create new key. The key is shown once — save it.

2. Authentication

Send the key in the header of every request:

# Required header Authorization: Bearer vv_xxxxxxxxxxxxxxxx

3. Generate speech

POST /api/v1/speech
ParameterTypeDescription
inputstring *Text to speak (max 20,000 chars)
voicestringVoice name (default: Hải Đăng). See /api/v1/voices
response_formatstringAlways returns wav
curl https://vietvoice.click/api/v1/speech \ -H "Authorization: Bearer vv_..." \ -H "Content-Type: application/json" \ -d '{"input": "Hello!", "voice": "Hải Đăng"}' \ --output audio.wav

✅ Success: HTTP 200, body is a WAV file (48kHz).
💰 Deducts 1 char / 1 text character — same as web generation.

4. List voices

GET /api/v1/voices

5. Check balance

GET /api/auth/me

Returns balance (remaining characters) and account info.

6. Error codes

CodeMeaning
401Missing/invalid API key
402Out of characters — top up in Studio
429Engine busy — retry in a few seconds

7. Notes

← Về trang chủ