增加器乐轨
curl --request POST \
--url https://apistable.com/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "suno_add_stem",
"input": {
"audio_id": "YOUR_AUDIO_ID",
"stem_prompt": "Piano"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno_add_stem',
input: {audio_id: 'YOUR_AUDIO_ID', stem_prompt: 'Piano'}
})
};
fetch('https://apistable.com/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.com/api/v1/tasks/create_task"
payload = {
"model": "suno_add_stem",
"input": {
"audio_id": "YOUR_AUDIO_ID",
"stem_prompt": "Piano"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Suno
增加器乐轨
为已有音频增加指定器乐轨,可选择返回新轨或等待混音。
POST
/
api
/
v1
/
tasks
/
create_task
增加器乐轨
curl --request POST \
--url https://apistable.com/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "suno_add_stem",
"input": {
"audio_id": "YOUR_AUDIO_ID",
"stem_prompt": "Piano"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno_add_stem',
input: {audio_id: 'YOUR_AUDIO_ID', stem_prompt: 'Piano'}
})
};
fetch('https://apistable.com/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.com/api/v1/tasks/create_task"
payload = {
"model": "suno_add_stem",
"input": {
"audio_id": "YOUR_AUDIO_ID",
"stem_prompt": "Piano"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}能力按服务端配置逐项启用。未启用操作返回 503 且不创建任务;音乐积分扣除当前未启用。
调用步骤
为已有音频增加指定器乐轨,可选择返回新轨或等待混音。-
- 按下方示例准备输入,将占位地址和 ID 换成你有权使用的资源。
-
- 将 model 设为 suno_add_stem,参数放在 input 内。提交一次并保存返回的 task_id。
-
- 查询已保存的任务,或接收回调。任务仍在处理中时继续等待,不重新提交同一操作。
- 从 result.data.data 读取作品。每首歌曲都有独立的本站 id,后续任务可将其作为 audio_id。
创建任务
将model和input发送到统一任务入口;可在顶层传公开HTTPS callback_url。资源ID均为本账户的本站ID。当前音乐积分扣除未启用。{
"model": "suno_add_stem",
"input": {
"audio_id": "YOUR_AUDIO_ID",
"stem_prompt": "Piano"
}
}
受理响应
HTTP 200仅表示受理。查询GET /api/v1/tasks/{task_id},直到data.status为succeeded或failed。成功后读取data.result;失败原因位于data.message。{
"code": 200,
"msg": "success",
"data": {
"task_id": "YOUR_TASK_ID"
}
}
参数速查
| 字段 | 类型 | 必填 | 说明与限制 |
|---|---|---|---|
| audio_id | string | 是 | 本账户的本站歌曲ID。翻唱/续写只传此ID,不传源task_id或外部URL。 maxLength: 200 |
| stem_prompt | string | 是 | PayAPI 扩展:描述要增加的器乐或背景轨。 maxLength: 1000 |
| model | string | 否 / 依条件 | Suno 版本:V6、V6_MINI 或 V6_WILD;续写需与生成原曲版本一致。 values: V6, V6_MINI, V6_WILD; default: V6 |
| title | string | 否 / 依条件 | 标题。生成/翻唱最多 80 字符,续写及其他操作最多 100 字符;自定义生成必填。 maxLength: 100 |
| result_mode | string | 否 / 依条件 | 续写/替换:full_song(默认)或 segment;加轨:mixed(默认)或 stem;完整/混合结果等待合并完成。 values: stem, mixed; default: mixed |
输入与限制
下方Schema列出支持字段、类型和基础限制;还须遵守“重要条件”,跨字段与来源资源校验不完全体现在JSON Schema中。未知参数会被拒绝。URL 参数仅接受公开 HTTPS 地址,不接受文件对象。{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"audio_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "本账户的本站歌曲ID。翻唱/续写只传此ID,不传源task_id或外部URL。"
},
"stem_prompt": {
"type": "string",
"minLength": 1,
"maxLength": 1000,
"description": "PayAPI 扩展:描述要增加的器乐或背景轨。"
},
"model": {
"default": "V6",
"type": "string",
"enum": [
"V6",
"V6_MINI",
"V6_WILD"
],
"description": "Suno 版本:V6、V6_MINI 或 V6_WILD;续写需与生成原曲版本一致。"
},
"title": {
"type": "string",
"maxLength": 100,
"description": "标题。生成/翻唱最多 80 字符,续写及其他操作最多 100 字符;自定义生成必填。"
},
"result_mode": {
"default": "mixed",
"type": "string",
"enum": [
"stem",
"mixed"
],
"description": "续写/替换:full_song(默认)或 segment;加轨:mixed(默认)或 stem;完整/混合结果等待合并完成。"
}
},
"required": [
"audio_id",
"stem_prompt"
],
"additionalProperties": false
}
重要条件
- full_song/mixed等待合并,segment/stem返回对应片段或器乐轨。合并失败不会把片段作为完整歌曲返回;部分成功会在结果消息中说明。
- 歌曲音频可能为MP3或M4A;需要真正MP3时使用suno_export_mp3。可选封面无法获取时可能为null,不影响音频使用。
- 上传文件保留24小时,生成文件保留14天,任务详情保留30天;复用文件沿用原到期时间。有效Voice/Persona身份映射与任务日志清理分开处理,请及时下载需长期保存的文件。
结果 Schema
创建响应为 {code:200,msg:“success”,data:{task_id}},轮询 GET /api/v1/tasks/{task_id}。成功时 data.result 为符合下方 Schema 的对象,其他状态为 null;input 仍为 JSON 字符串。{
"type": "object",
"required": [
"code",
"msg",
"data"
],
"properties": {
"code": {
"const": 200
},
"msg": {
"type": "string"
},
"data": {
"type": "object",
"required": [
"callbackType",
"task_id",
"data"
],
"properties": {
"callbackType": {
"const": "complete"
},
"task_id": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"audio_url",
"stream_audio_url",
"image_url",
"prompt",
"lyrics",
"model_name",
"title",
"createTime",
"duration",
"tags",
"source_audio_url",
"source_image_url",
"source_stream_audio_url"
],
"properties": {
"id": {
"type": "string"
},
"audio_url": {
"type": "string"
},
"stream_audio_url": {
"type": [
"string",
"null"
]
},
"image_url": {
"type": [
"string",
"null"
]
},
"prompt": {
"type": "string"
},
"lyrics": {
"type": [
"string",
"null"
]
},
"model_name": {
"type": [
"string",
"null"
]
},
"title": {
"type": [
"string",
"null"
]
},
"createTime": {
"type": [
"integer",
"null"
]
},
"duration": {
"type": [
"number",
"null"
]
},
"tags": {
"type": [
"string",
"null"
]
},
"source_audio_url": {
"type": "string"
},
"source_image_url": {
"type": [
"string",
"null"
]
},
"source_stream_audio_url": {
"type": [
"string",
"null"
]
}
}
}
}
}
}
}
}
歌曲duration单位为秒,任务duration单位为毫秒;createTime是毫秒Unix时间戳或null。目前stream_audio_url和source_stream_audio_url均为null;source_audio_url/source_image_url与audio_url/image_url指向同一本站托管副本,并非供应商直链。请遍历实际歌曲数组,注册上传音频不代表新生成两首歌曲。
相关流程
Voice 完整四步 文件上传 回调授权
Every valid key can submit and query its own account. Revoked keys are rejected.
请求体
application/json