LarVoice Docs

Quản lý API Về Dashboard

Tài liệu API (Interactive)

Hệ thống API RESTful siêu tốc. Đặc biệt, bạn có thể gắn dán API Key lên thanh header và bấm [▶ Chạy Thử sandbox] trực tiếp ngay trên tài liệu này mà không cần mở Postman!

Tải Tài Liệu Markdown (Dành cho AI)

Tra cứu Số dư

Lấy thông tin tài khoản và kiểm tra hạn mức tín dụng còn lại để cảnh báo nạp thêm.

GET /me
const axios = require('axios');

axios.get('https://larvoice.com/api/v2/me', {
  headers: { 'Authorization': 'Bearer sk-YOUR_API_KEY' }
}).then(res => console.log(res.data));
Requires API Key

Text To Speech (TTS Stream)

Sinh AI Audio cực đỉnh hỗ trợ Streaming. Quá trình gồm 2 bước: khởi tạo phiên chạy, và tải âm thanh từng câu liên tục.

POST /tts_stream
const axios = require('axios');

const res = await axios.post('https://larvoice.com/api/v2/tts_stream', {
  "text": "LarVoice API nhanh như một cơn gió!",
  "ref_voice_id": 1,
  "language": "vi",
  "audio_format": "mp3",
  "speed": 1, "run_speed": 1, "pitch": 1, "volume": 1, 
  "strength": 2.2, "bass": 0, "treble": 0, "compress": 0, 
  "pause": 0, "first_trim_ms": 0, "last_trim_ms": 0, "split_by_newline": false
}, {
  headers: { 'Authorization': 'Bearer sk-YOUR_API_KEY' }
});

const { stream_status_url, base_url } = res.data.data;
let interval = setInterval(async () => {
    let statusRes = await axios.get(stream_status_url, { headers: { 'Authorization': 'Bearer sk-YOUR_API_KEY' }});
    console.log(statusRes.data);
    if (statusRes.data.status === 'done') clearInterval(interval);
}, 1000);
Sẽ trừ tín dụng tài khoản test