Elevenlabs Music V2.5 API Documentation
Playground
Try it on WaveSpeedAI!ElevenLabs Music v2.5 Text-to-Music generates songs with vocals or instrumental music from text prompts, with configurable duration and MP3 output for songwriting demos, background music, social content, ads, and creative audio production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
ElevenLabs Music v2.5 generates songs with vocals or instrumental tracks from a text description. Describe the genre, mood, instrumentation, vocal style, and optional original lyrics, then set the requested duration and output format to generate a complete music track.
Music v2.5 improves audio quality and prompt adherence over Music v2.
Why Choose This?
-
Prompt-to-music generation
Generate music directly from a text description. -
Vocal or instrumental output
Create songs with vocals based on the prompt, or enableforce_instrumentalfor instrumental-only music. -
Improved prompt adherence
Follow music direction more closely for genre, mood, arrangement, instrumentation, and vocal style. -
Duration control
Set the requested music length from3seconds to10minutes. -
Multilingual vocal support
Generate songs with vocals in different languages when specified in the prompt. -
MP3 output format control
Choose the MP3 codec, sample rate, and bitrate throughoutput_format.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Music description and optional original lyrics. Include genre, mood, instrumentation, vocal style, language, and production direction. Length: 1–4100 characters. |
| music_length_ms | Yes | Requested duration in milliseconds. Range: 3000–600000, from 3 seconds to 10 minutes. The playground starts at 30000 milliseconds. |
| force_instrumental | No | Set to true for instrumental-only music. Default: false. When disabled, vocals depend on the prompt. |
| output_format | No | MP3 codec, sample rate, and bitrate. Default: mp3_48000_192. |
How to Use
- Write your prompt — Describe the genre, mood, instruments, tempo, vocal style, language, and optional original lyrics.
- Set duration — Choose
music_length_msfrom3000to600000. - Choose instrumental mode optional — Enable
force_instrumentalwhen you want music without vocals. - Choose output format optional — Use the default
mp3_48000_192or select another supported MP3 output format. - Submit — Generate the music track and retrieve the output.
Output
One generated MP3 audio URL is returned in data.outputs[0].
Submit the job and poll the WaveSpeed prediction result endpoint until the task completes.
Pricing
Pricing is based on the requested music_length_ms.
Billing is calculated per started minute. Requested duration is rounded up to the next whole minute, with a minimum billed duration of 1 minute.
| Billing Unit | Cost |
|---|---|
| Per started minute | $0.75 |
Example Costs
| Requested Duration | Billed Minutes | Cost |
|---|---|---|
| 3 seconds | 1 | $0.75 |
| 30 seconds | 1 | $0.75 |
| 60 seconds | 1 | $0.75 |
| 61 seconds | 2 | $1.50 |
| 120 seconds | 2 | $1.50 |
| 300 seconds | 5 | $3.75 |
| 600 seconds | 10 | $7.50 |
Best Use Cases
- Song generation — Create complete songs from a descriptive prompt and optional original lyrics.
- Instrumental music — Generate backing tracks, music beds, loops, or soundtrack-style audio.
- Multilingual vocal tracks — Create vocal music in different languages by specifying the language in the prompt.
- Content creation — Generate music for videos, podcasts, ads, games, and social media.
- Creative prototyping — Test different genres, moods, arrangements, and vocal directions quickly.
- Custom soundtrack workflows — Create tracks tailored to a specific scene, product, brand, or story.
Pro Tips
- Include genre, mood, instruments, tempo, vocal style, and production cues in the prompt.
- Add original lyrics directly in the prompt when you want more control over the song content.
- Use
force_instrumental=truewhen you need background music without vocals. - Set the duration close to what you actually need, since billing uses the requested duration.
- Use concise, specific music direction instead of mixing too many unrelated genres.
- Keep vocals, language, and lyrical direction clear when generating songs with singing.
- Use instrumental prompts when you need clean background music for video or media workflows.
Notes
promptandmusic_length_msare required.music_length_mssupports3000–600000milliseconds.- The minimum billed duration is
1started minute. - Billing is based on requested duration, not measured output length.
- Automatic duration, composition plans, reference audio, and seed are not exposed in this version.
- Do not submit unsupported fields.
Related Models
- ElevenLabs Music — Generate music from text prompts with the earlier ElevenLabs Music workflow.
- ElevenLabs Music v2 — Generate vocal or instrumental music with prompt-based duration control.
- ElevenLabs Music v2.5 — Generate upgraded vocal or instrumental music from prompt-based instructions.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"music_length_ms": 30000,
"force_instrumental": false,
"output_format": "mp3_48000_192"
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/elevenlabs/music-v2.5" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | - | Describe the genre, mood, instruments, vocals and optional lyrics of the music to generate. Maximum 4,100 characters. | |
| music_length_ms | integer | Yes | 30000 | 3000 ~ 600000 | Requested music duration in milliseconds (3,000-600,000; 30,000 = 30 seconds). Required for predictable pricing; automatic duration is not supported. |
| force_instrumental | boolean | No | false | - | If true, guarantees instrumental music without vocals. If false, vocals depend on the prompt. |
| output_format | string | No | mp3_48000_192 | mp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, mp3_48000_128, mp3_48000_192, mp3_48000_240, mp3_48000_320 | MP3 output format, written as codec_sample_rate_bitrate. Default: mp3_48000_192 (48 kHz, 192 kbps). |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |