Skip to content

音乐生成

音乐生成用于创建歌曲、纯音乐和音效。任务提交后返回任务 ID,再通过通用任务查询接口获取结果。

生成歌曲

bash
curl https://moonapix.com/v1/tasks \
  -H "Authorization: Bearer <MOONAPIX_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/moonapix/webhook"
  }'

生成纯音乐

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/moonapix/webhook"
}

生成音效

bash
curl https://moonapix.com/v1/tasks \
  -H "Authorization: Bearer <MOONAPIX_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "suno-sounds-v5",
    "prompt": "A clean notification sound, short, bright, modern.",
    "callBackUrl": "https://example.com/moonapix/webhook"
  }'

必填字段

模型族必填字段
suno-music-*customModeinstrumentalcallBackUrl;当 customMode=true 时还需要 promptstyletitle
suno-sounds-v5prompt;建议同时提供 callBackUrl

查询结果

bash
curl https://moonapix.com/v1/tasks/task_xxx \
  -H "Authorization: Bearer <MOONAPIX_API_KEY>"

更多查询说明见 查询和下载