Music Generation
Music generation is used to create songs, pure music and sound. task returns task ID after submission, and results are obtained by General task query API.
Generate songs
bash
curl https://moonnexai.com/v1/tasks \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-music-v5.5",
"prompt": "A hopeful pop song about finding light after a long night.",
"style": "Pop, Warm, Emotional",
"title": "Morning Light",
"customMode": true,
"instrumental": false,
"callBackUrl": "https://example.com/moonnexai/webhook"
}'Generate pure music
json
{
"model": "suno-music-v5.5",
"prompt": "Warm cinematic background music for a product launch.",
"style": "Cinematic, Warm, Corporate",
"title": "Launch Day",
"customMode": true,
"instrumental": true,
"callBackUrl": "https://example.com/moonnexai/webhook"
}Generate sound
bash
curl https://moonnexai.com/v1/tasks \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-sounds-v5",
"prompt": "A clean notification sound, short, bright, modern.",
"callBackUrl": "https://example.com/moonnexai/webhook"
}'You will fill in field
| Model family | You will fill in field |
|---|---|
suno-music-* | customMode, instrumental, callBackUrl; when customMode=true, also supply prompt, style, title |
suno-sounds-v5 | prompt;suggested to provide callBackUrl at the same time |
Query Results
bash
curl https://moonnexai.com/v1/tasks/task_xxx \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>"For more information see Query and download.