跳转到内容

V1.0

AI 音乐生成 API 把主题、歌词和/或音乐风格变成一首完整的歌。每个任务返回一首成品歌曲(mp3),附封面图、标题、歌词与歌词同步时间戳。

运行 AI 音乐生成任务。

请求

AI 任务是异步处理的。功能支持 Webhook 时,优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名,收到 success 或 error 通知后,用收到的 task_id 查询任务结果。配置与校验的细节请见 Webhook 接入指南。

若功能不支持 Webhook,或您的接入方式用不了 Webhook,就请实现轮询。提交 AI 任务后,按固定间隔(例如每 10 秒)轮询状态接口,直到任务状态变为 success 或 error。

安全
BearerAuthenticationV2
正文application/json必需
Any of:
ideastring, [ 1 .. 500 ] characters必需

歌曲主题。instrumental 为 true 时必填。带人声的歌曲请提供 idea、lyrics 或两者。 想要特定语言的歌词,就在这里提出(例如 "with Japanese lyrics")。

默认值:""
示例:"A song about a small café that stays open late for people who can't sleep"
lyricsstring, <= 3000 characters

歌曲歌词。支持 [intro]、[verse]、[chorus]、[outro] 等段落标签。支持的歌词语言: 英语、日语、韩语、葡萄牙语、西班牙语、德语、法语、意大利语、繁体中文、简体中文、印地语、土耳其语。

默认值:""
示例:"[verse]\nTwo a.m., the neon hums\nSteam on the glass, the night still runs\n\n[chorus]\nLeave the light on, leave the light on\nFor the ones who don'
music_styleobject

歌曲的音乐风格。所有字段均可选。

instrumentalboolean

设为 true 生成无人声、无歌词的纯音乐。

默认值:false
示例:false
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/ai-song \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "idea": "A song about a small café that stays open late for people who can'\''t sleep",
    "lyrics": "[verse]\nTwo a.m., the neon hums\nSteam on the glass, the night still runs\n\n[chorus]\nLeave the light on, leave the light on\nFor the ones who don'\''t go home",
    "music_style": {
      "genre": "Acoustic Pop",
      "mood": "Calm, hopeful",
      "vocal": "female",
      "description": "soft piano, brushed drums"
    },
    "instrumental": false
  }'

响应

任务运行成功

正文application/json
statusinteger

响应状态

示例:200
dataobject
响应
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }