ElevenLabs Music v2
elevenlabs/music/2ElevenLabs Music v2 generates studio-quality songs and instrumentals with vocals from a text prompt, up to 10 minutes long.
- Giá cơ bản
- $0.75USD / lần chạy
- Thực thi
- async
- Loại model
- audio
- Các trường đầu vào
- 3
Thử model
Phòng thử nghiệm
Bạn muốn làm gì tiếp theo?
Ví dụ
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào playground.
- Mở kết quả ↗
Đầu vào
{ "prompt": "Mysterious original soundtrack, themes of jungle, rainforest, nature, woodwinds, busy rhythmic tribal percussion." }
Thẻ model
Thông số kỹ thuật
Giá
- Giá cơ bản
- $0.75 / 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
- ElevenLabs
- ID mô hình
- elevenlabs/music/2
- Thực thi
- async
- URL cơ sở
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
README API
ElevenLabs Music v2
ElevenLabs Music v2: studio-quality songs and instrumentals with vocals, up to 10 minutes.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Genre, mood, instruments, vocals, and lyrics. |
force_instrumental | boolean | false | Generate without vocals. |
music_length_ms | integer 3000–600000 | — | Length in milliseconds (3,000–600,000). |
Billing
$0.75 per started minute, with a one-minute minimum. Without music_length_ms the quote assumes 1 minute.
| Length | Price |
|---|---|
| 30s | $0.75 |
| 60s | $0.75 |
| 150s | $2.25 |
| 600s | $7.50 |
Failed runs are not charged.
Prompting
- Describe structure and vocals; put lyrics in the prompt if you need exact words.
Limits
- Up to 10 minutes.
Also on SandBase
Other ElevenLabs Music versions: elevenlabs/music, elevenlabs/music/2.5.
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": "elevenlabs/music/2",
"prompt": "Mysterious original soundtrack, themes of jungle, rainforest, nature, woodwinds, busy rhythmic tribal percussion.",
"force_instrumental": 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
3 tham số · 1 bắt buộc · 2 tùy chọn
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
prompt | string | Bắt buộc | The text prompt describing the music to generate |
music_length_ms | integer | Tùy chọn | The length of the song to generate in milliseconds (3000-600000). If not provided, the model will choose a length based on the prompt. · Tối thiểu: 3000 · Tối đa: 600000 |
force_instrumental | boolean | Tùy chọn | If true, guarantees that the generated song will be instrumental. · 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 |
|---|---|---|---|
ElevenLabs Music v2Mô hình này ElevenLabs | Âm thanh | $0.75 / lượt chạy | 14 thg 9, 2026 |
ElevenLabs | Âm thanh | $0.01 / lượt chạy | 2 thg 11, 2026 |
ElevenLabs | Âm thanh | $0.04 / lượt chạy | 28 thg 9, 2026 |
ElevenLabs | Âm thanh | $0.08 / lượt chạy | 28 thg 9, 2026 |
ElevenLabs | Âm thanh | $0.75 / lượt chạy | 14 thg 9, 2026 |
ElevenLabs | Âm thanh | $0.30 / lượt chạy | 8 thg 9, 2026 |
Câu hỏi
FAQ
Làm thế nào để gọi ElevenLabs Music v2 qua SandBase?
Tạo một API key SandBase, sau đó gửi yêu cầu với model ID "elevenlabs/music/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 ElevenLabs 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 ElevenLabs Music v2 và các model khác trong danh mục; bạn không cần đăng ký riêng với ElevenLabs.
