Music Generation
Music Generation with Suno v3.5
Last Modifiy Date: 2024-09-05
Key Features
- High-Quality Music Generation: Create music tracks based on descriptive prompts.
- Flexible Integration: Compatible with various programming languages and frameworks.
Generate Music
Endpoint: POST /api/generate
Description: Generate music based on a given text prompt using the Suno v3.5 model. Available models include chirp-v3-5 and chirp-v3-0. This endpoint will automatically fill in the lyrics.
curl -X POST "https://udioapi.pro/api/generate" \
-H "Content-Type: application/json" \
-d '{
"title": "",
"prompt": "",
"gpt_description_prompt":"",
"custom_mode":false,
"make_instrumental": false,
"model": "chirp-v3.0",
"callback_url":"",
"disable_callback": false,
"token":"{{ your token }}"
}'
- title: Music title
- prompt: generate music prompt, If the content is too long, the generation will fail with "Topic too long."
- gpt_description_prompt: Can input music style, If the content is too long, the generation will fail with "Topic too long."
- custom_mode: This parameter exists only in the suno-v3 model.
- make_instrumental: false,
- model: Options include chirp-v3.0, chirp-v3.5, udio-130, udio-32,
- udio-130: Generate 2:10 clips. Takes longer
- udio-32: Generate 32s clips
- callback_url : Optional field, but it is recommended to use your own address due to potential delays with our forwarding
- disable_callback : The default value of disable_callback is false. If you do not provide the callback_url parameter and set disable_callback to true, we will store your generated results on our server, but this data will be retained for a maximum of 30 days.
- token: your api_key Required field
Custom Mode: If you want to use customMode, make sure the following parameters exist.
customMode | instrumental | Required Parameters |
---|---|---|
true | false | style, prompt, title |
true | true | style, title |
false | true | prompt |
false | false | prompt |
Submit Generation Task Response
{
message: 'success',
workId: 'workId'
}
- workId: Fields used to query generate results
Generate Callback Sample
{
"code": 200,
"data": {
"callbackType": "complete",
"data": [
{
"audio_url": "https://xxx.mp3",
"createTime": 1717587606036,
"duration": 146.08,
"id": "59001af3-845d-47af-9e23-625adb0c6505",
"image_url": "https://xxx.png",
"model_name": "chirp-v3.5",
"prompt": "[Verse]xxx[Verse 2]xxx[Chorus]xxx[Verse 3]xxx[Bridge]xxx[Chorus]xxx",
"tags": "melodic pop piano",
"title": "xxx"
},
{
"audio_url": "https://xxx.mp3",
"createTime": 1717587606036,
"duration": 240,
"id": "b0fa4b03-89d2-4c6d-82ea-28aa2604fee6",
"image_url": "https://xxx.png",
"model_name": "chirp-v3.5",
"prompt": "[Verse]xxx[Verse 2]xxx[Chorus]xxx[Verse 3]xxx[Bridge]xxx[Chorus]xxx",
"tags": "melodic pop piano",
"title": "xxx"
}
]
},
"msg": "All generated successfully."
}
About CallBack Url
Once the cover, title, and lyrics are successfully generated, we will make a callback to the "callback URL" you provided in the generation interface. Please note that the generated files will only be retained for 30 days.
Note: In some cases, the official website may skip the 'text' and 'first' stages and directly mark the task as 'complete'. Be aware of this possibility.
The callback method will be "POST", and the "Content-Type" should be set to "application/json".