Generate Music

POST

https://api.sunosay.com/suno/music/generate-music

Creating Generate Music


Request Header

Header NametypeRequiredDescription
Authorizationstringtruerequest verification authorization

Request Parameters

Params NametypeRequiredDescription
titlestringtrueMusic title
tagsstringtrueMusic style tags, example: Symphony, Chamber Music, Symphonic Poem. note that styles should be separated by commas
promptstringtrueLyrics or song description, up to 3000 characters
negative_tagsstringfalseElements that won't appear in the music
modelstringfalsemusic Generate Models Default v3.5 , Click to view other model

Sample Parameters

{
  "title": "Echoes of Solitude",
  "tags": "Dream-Folk 、Indie-Ambient",
  "prompt": "Wandering through the hazy corridors of memory, 'Echoes of Solitude' weaves a tapestry of melancholic melodies that embrace the listener in a warm yet lonely embrace. The vocals, a soft whisper against the night, intertwine with the gentle strumming of an acoustic guitar, painting a picture of solitude that is both beautiful and haunting. Layers of ethereal synths rise and fall like the tide, carrying the song towards depths unknown, while the drums pulse with a distant, almost tribal rhythm, adding a touch of mystery to the already atmospheric soundscape. This is a track that embodies the quiet introspection of a soul seeking solace in the vastness of its own thoughts, a stylistic blend of dream-pop and indie-folk that lingers long after the final note fades away."
}

Response Body

Response NametypeDescription
codenumberTask creation code 200 means success other status values ​​mean failure
task_idstringGet the generated music task_id
messagestringSuccess message or failure error message

Sample Response

{
  "code": 200,
  "task_id": "4976bdbf8-b5c9-4eda-b5131-40f0e8fc875e",
  "message": "ok!"
}

Examples Code

node
var axios = require('axios');
var data = '<body data here>';

var config = {
  method: 'post',
  url: 'https://api.sunosay.com/suno/music/generate-music',
  headers: {
    Authorization: 'Bearer your-api-key',
  },
  data: {
    title: 'Echoes of Solitude',
    tags: 'Dream-Folk 、Indie-Ambient',
    prompt:
      "Wandering through the hazy corridors of memory, 'Echoes of Solitude' weaves a tapestry of melancholic melodies that embrace the listener in a warm yet lonely embrace. The vocals, a soft whisper against the night, intertwine with the gentle strumming of an acoustic guitar, painting a picture of solitude that is both beautiful and haunting. Layers of ethereal synths rise and fall like the tide, carrying the song towards depths unknown, while the drums pulse with a distant, almost tribal rhythm, adding a touch of mystery to the already atmospheric soundscape. This is a track that embodies the quiet introspection of a soul seeking solace in the vastness of its own thoughts, a stylistic blend of dream-pop and indie-folk that lingers long after the final note fades away.",
  },
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });