Index TTS 2.0
sandbase-ai/index-tts-2Index TTS 2.0 from bilibili's IndexTeam speaks text in the voice of a reference recording (zero-shot cloning) and controls emotion separately through a second reference clip, per-emotion strengths, or a text description.
- Giá cơ bản
- $0.02USD / lần chạy
- Thực thi
- async
- Loại model
- audio
- Các trường đầu vào
- 7
Thử model
Phòng thử nghiệm
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Thẻ model
Thông số kỹ thuật
Giá
- Giá cơ bản
- $0.02 / lần chạy
Ngữ cảnh & phương thức
- Đầu vào
- Định nghĩa theo schema
- Đầu ra
- audio
Tính năng
- Chat
- Không được hỗ trợ
- Thị giác
- Không được hỗ trợ
- Suy luận
- Không được hỗ trợ
- Đầu ra có cấu trúc
- Không được hỗ trợ
- Gọi hàm
- Không được hỗ trợ
- Đầu vào âm thanh
- Không được hỗ trợ
Truy cập
- Nhà cung cấp
- sandbase-ai
- ID mô hình
- sandbase-ai/index-tts-2
- Thực thi
- async
- URL cơ sở
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
README API
Index TTS 2.0
Index TTS 2.0 clones the voice in a reference clip and speaks new text with it. Emotion is controlled separately: from a second reference clip, eight per-emotion strengths, or the emotion inferred from text.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
text | string, required | — | Text to speak. |
audio | audio file or URL, required | — | Voice to clone. |
emotional_audio | audio file or URL | — | Clip whose emotional style is transferred. |
strength | number 0–1 | 1 | Strength of the emotional style transfer. |
emotional_strengths | object of numbers 0–1 | — | happy, angry, sad, afraid, disgusted, melancholic, surprised, calm. |
should_use_prompt_for_emotion | boolean | false | Infer emotion from the text or emotion_prompt; overrides emotional_strengths. |
emotion_prompt | string | — | Text describing the emotion; used when should_use_prompt_for_emotion is true. |
Billing
$0.002 per second of generated audio. The quote before submission assumes 10 seconds; the final charge uses the measured output length.
| Output | Price |
|---|---|
| 10 seconds | $0.02 |
| 30 seconds | $0.06 |
| 1 minute | $0.12 |
Failed runs are not charged.
Prompting
- Use a clean 5–15 second reference clip of a single speaker.
- Pick one emotion control: a reference clip,
emotional_strengths, orshould_use_prompt_for_emotion.
Bắt đầu xây dựng
Gửi request đầu tiên của bạn
Endpoint tương thích OpenAI với xác thực và theo dõi mức sử dụng thống nhất.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "sandbase-ai/index-tts-2",
"text": "Hide! He's coming! He's coming to get us!",
"audio": "https://storage.googleapis.com/falserverless/example_inputs/index-tts-2/tts_in.mp3",
"strength": 1,
"emotion_prompt": "You scared me to death! What are you, a ghost?",
"should_use_prompt_for_emotion": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Schema đầu vào
7 tham số · 2 bắt buộc · 5 tùy chọn
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
text | string | Bắt buộc | The text to speak. |
audio | string | Bắt buộc | Reference speech audio file or URL; the output is spoken in this voice (zero-shot cloning). |
strength | number | Tùy chọn | Strength of the emotional style transfer. Higher values give stronger emotional influence. · Tối thiểu: 0 · Tối đa: 1 · Mặc định: 1 |
emotion_prompt | string | Tùy chọn | Text whose emotion is used instead of the spoken text. Requires should_use_prompt_for_emotion. |
emotional_audio | string | Tùy chọn | Optional audio file or URL whose emotional style is transferred to the output. |
emotional_strengths | object | Tùy chọn | Per-emotion strengths (0-1) for fine-grained control: happy, angry, sad, afraid, disgusted, melancholic, surprised, calm. |
should_use_prompt_for_emotion | boolean | Tùy chọn | Derive emotional strengths from the text (or from emotion_prompt when set). Overrides emotional_strengths. · Mặc định: false |
Schema đầu ra
| Trường | Kiểu | Mô tả |
|---|---|---|
id | string | Mã định danh duy nhất cho tác vụ tạo |
status | string | Trạng thái tác vụ: pending, running, completed, failed, timeout |
model | string | Model được dùng cho quá trình tạo |
outputs | array | Mảng các mục đầu ra |
outputs[].url | string | URL của artifact đã tạo |
outputs[].content_type | string | Kiểu MIME (ví dụ image/png, video/mp4) |
error | object | null | Chi tiết lỗi nếu thất bại, null nếu thành công |
error.type | string | Mã loại lỗi có thể đọc bằng máy |
error.message | string | Mô tả lỗi dễ đọc cho người dùng |
Quy trình không đồng bộ
Model này chạy bất đồng bộ. Gửi yêu cầu, rồi thăm dò để lấy kết quả.
- Gửi: POST tới /v1/run và đọc
idđược trả về. - Thăm dò: GET /v1/run/{id} cho đến khi trạng thái là
completed,failedhoặctimeout. - Truy xuất: đọc
outputstừ phản hồi hoàn tất.
Chọn model của bạn
So sánh model
| Mô hình | Loại | Giá mặc định | Phát hành |
|---|---|---|---|
Index TTS 2.0Mô hình này sandbase-ai | Âm thanh | $0.02 / lượt chạy | 7 thg 10, 2025 |
SandBase AI | Âm thanh | $0.01 / lượt chạy | 16 thg 6, 2026 |
SandBase AI | Âm thanh | $0.06 / lượt chạy | 7 thg 1, 2026 |
SandBase AI | Âm thanh | $0.01 / lượt chạy | 24 thg 10, 2025 |
SandBase AI | Âm thanh | $0.05 / lượt chạy | 4 thg 4, 2025 |
SandBase AI | Âm thanh | $0.05 / lượt chạy | 4 thg 4, 2025 |
Câu hỏi
FAQ
Làm thế nào để gọi sandbase-ai Index TTS 2.0 qua SandBase?
Tạo một API key SandBase, sau đó gửi yêu cầu với model ID "sandbase-ai/index-tts-2" tới Unified Run API (/v1/run) tại https://api.sandbase.ai. Các ví dụ yêu cầu trên trang này cho thấy chính xác payload.
Tôi có cần tài khoản sandbase-ai riêng không?
Không. Chỉ cần một API key và số dư SandBase là bạn có thể truy cập sandbase-ai Index TTS 2.0 và các model khác trong danh mục; bạn không cần đăng ký riêng với sandbase-ai.
