Generate Music
POST/api/v1/generate
Generate music with or without lyrics using AI models.
Usage Guide
- This endpoint creates music based on your text prompt
- Multiple variations will be generated for each request
- You can control detail level with custom mode and instrumental settings
Parameter Details
-
In Custom Mode (
customMode: true
):- If
instrumental: true
:style
andtitle
are required - If
instrumental: false
:style
,prompt
, andtitle
are required prompt
length limit: 3000 charactersstyle
length limit: 200 characterstitle
length limit: 80 characters
- If
-
In Non-custom Mode (
customMode: false
):- Only
prompt
is required regardless ofinstrumental
setting prompt
length limit: 400 characters- Other parameters should be left empty
- Only
Developer Notes
- Recommendation for new users: Start with
customMode: false
for simpler usage - Generated files are retained for 14 days
- Callback process has three stages:
text
(text generation),first
(first track complete),complete
(all tracks complete)
Request
Responses
- 200
- 500
Request successful
Server Error
Callbacks
- POST audioGenerated
POST{request.body#/callBackUrl}
System will call this callback when audio generation is complete.
Callback Example
{
"code": 200,
"msg": "All generated successfully.",
"data": {
"callbackType": "complete",
"task_id": "2fac****9f72",
"data": [
{
"id": "8551****662c",
"audio_url": "https://example.cn/****.mp3",
"stream_audio_url": "https://example.cn/****",
"image_url": "https://example.cn/****.jpeg",
"prompt": "[Verse] Night city lights shining bright",
"model_name": "chirp-v3-5",
"title": "Iron Man",
"tags": "electrifying, rock",
"createTime": "2025-01-01 00:00:00",
"duration": 198.44
},
{
"id": "bd15****1873",
"audio_url": "https://example.cn/****.mp3",
"stream_audio_url": "https://example.cn/****",
"image_url": "https://example.cn/****.jpeg",
"prompt": "[Verse] Night city lights shining bright",
"model_name": "chirp-v3-5",
"title": "Iron Man",
"tags": "electrifying, rock",
"createTime": "2025-01-01 00:00:00",
"duration": 228.28
}
]
}
}
Callbacks Responses
- 200
Callback received successfully