Create
https://api.sunoapi.com/api/v1/suno/create
The core API to generate your music.
POST /api/v1/suno/create
Sample Request
{
"prompt": "[Verse]\nTesla riding\nBatteries flying\nElon Musk\nHe's got the future on his mind\nSolar panels shining\nRockets reaching for the skies\nInnovation's flowing\nHe's the tech wizard of our times\n\n[Verse]\nNeuralink connecting minds\nAI running wild\nMars colonization\nHe's making it his style\nFrom PayPal he came and shook the world with his touch\nElon Musk\nThe eccentric genius\nHe's too much\n\n[Chorus]\nElon Musk\nHe's the man with electric dreams\nChanging the world with his technology schemes\nFrom PayPal to SpaceX\nHe's a force to be seen\nElectric cars and rockets\nHe's living the dream",
"tags": "epic reggae",
"custom_mode": true,
"title": "Electric Dreams",
"continue_at": 0,
"continue_clip_id": ""
}
Request Body
Name | Type | Required | Default |
---|---|---|---|
prompt | string | true | "" |
tags | string | false | "" |
custom_mode | boolean | false | false |
title | string | false | "" |
continue_at | number | false | 0 |
continue_clip_id | string | false | "" |
prompt
The lyrics or description of the song. This field is required when the custom_mode
is set to true
.
When the custom_mode
is set to false
, this field becomes optional, and you can include an description of the song less than 200 characters in the prompt
field.
tags
Style of Music. e.g. "heavy metal", "gospel", "jazz", etc.
custom_mode
This field is used to enable the custom mode. When set to true
, the prompt
field is required. and you can use the prompt as a lyrics field to generate a song with your own lyrics under 3000 characters.
title
The title of the song. This field is optional, and only used when the custom_mode
is set to true
.
continue_at
This field is used to continue the generation of the song from a specific point. When set to a number, the API will continue the generation from that point.
continue_clip_id
This field is used to continue the generation of the song from a specific clip by the clip ID. When set to a string, the API will continue the generation from that clip.
Sample Response
{
"code": 200,
"data": {
"task_id": "b09d79f9-bd8f-4d51-8e8e-a7e1cb22f139"
},
"message": "success"
}
Response Body
Name | Type | Description |
---|---|---|
code | number | the HTTP status code of the response |
data | object | the data of the response |
message | string | the message of the response |
data
Name | Type | Description |
---|---|---|
task_id | string | the task ID of the song generation job |
task_id
The task ID of the song generation job, which can be used to query the progress of the job and retrieve the generated song. You can use this ID to retrieve the song from the API clip.
Examples
const axios = require("axios")
const config = {
method: "post",
url: "https://api.sunoapi.com/api/v1/suno/create",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <your-token>",
},
data: {
prompt:
"[Verse]\nTesla riding\nBatteries flying\nElon Musk\nHe's got the future on his mind\nSolar panels shining\nRockets reaching for the skies\nInnovation's flowing\nHe's the tech wizard of our times\n\n[Verse]\nNeuralink connecting minds\nAI running wild\nMars colonization\nHe's making it his style\nFrom PayPal he came and shook the world with his touch\nElon Musk\nThe eccentric genius\nHe's too much\n\n[Chorus]\nElon Musk\nHe's the man with electric dreams\nChanging the world with his technology schemes\nFrom PayPal to SpaceX\nHe's a force to be seen\nElectric cars and rockets\nHe's living the dream",
tags: "epic reggae",
custom_mode: true,
title: "Electric Dreams",
},
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})