curl --request POST \
--url https://api.aihubmax.com/e/v1/audios/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "elevenlabs-music-v2.5",
"prompt": "Gentle piano and warm strings for a quiet evening, no vocals.",
"music_length_ms": 30000,
"force_instrumental": true
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "audio.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "audio"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}Music Generation
ElevenLabs Music v2.5
Generate music from exactly one of prompt and composition_plan, using integer milliseconds. Auto output resolves to MP3; optional C2PA signing is MP3-only.
Submit asynchronously and query the task. Download results[0].url on completion. Only returned metadata is preserved; save audio promptly.
POST
/
v1
/
audios
/
generations
curl --request POST \
--url https://api.aihubmax.com/e/v1/audios/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "elevenlabs-music-v2.5",
"prompt": "Gentle piano and warm strings for a quiet evening, no vocals.",
"music_length_ms": 30000,
"force_instrumental": true
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "audio.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "audio"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}Provide exactly one of
prompt and composition_plan. Prompt accepts up to4100 characters. In prompt mode, music_length_ms is an integer from3000 to600000ms; omit it to let the model choose. force_instrumental defaults to false and is only valid in prompt mode.
A plan has1–30 ordered chunks, totaling3000–600000ms. Each requires text (may be empty), duration_ms (3000–120000) and positive_styles. Negative styles and context_adherence are optional. Lyrics allow at most30 lines of200 characters per chunk. Seed is only valid with a plan and does not guarantee reproducibility.
output_format defaults to auto, resolving to mp3_48000_192. sign_with_c2pa defaults to false and requires MP3 (including auto); it never silently changes your format. Audio references, explicit timestamps (including false), and safety controls retain their full meaning; unavailable combinations fail explicitly.
Actual complete output duration is rounded up to whole minutes at $0.6/minute. Both3 seconds and60 seconds count as1 minute; over60 seconds counts as2. Requested duration estimates the reservation; decoded output duration, saved prices and group multipliers determine final settlement.
Query the task and download results[0].url. Composition plans, song metadata and word timestamps are retained only when returned; ordinary audio may have no detailed metadata. Decode raw formats using returned sample rate, channels and Content-Type, and save audio promptly.Authorizations
Body
application/json
Output format. Auto resolves to mp3_48000_192. Signing never changes the specified format.
Available options:
auto, mp3_22050_32, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192, mp3_24000_48, mp3_48000_128, mp3_48000_192, mp3_48000_240, mp3_48000_320, pcm_32000 Example:
"mp3_48000_192"
Response
Task created