人声分离与分轨
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "suno_separate_vocals",
"input": {
"type": "separate_vocal",
"upload_url": "https://example.com/song.mp3"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno_separate_vocals',
input: {type: 'separate_vocal', upload_url: 'https://example.com/song.mp3'}
})
};
fetch('https://apistable.ai/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.ai/api/v1/tasks/create_task"
payload = {
"model": "suno_separate_vocals",
"input": {
"type": "separate_vocal",
"upload_url": "https://example.com/song.mp3"
}
}
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
人声分离与分轨
工具箱模式填写音频 URL;原生分轨选择本站歌曲 ID,按返回轨道分别试听和下载。
POST
/
api
/
v1
/
tasks
/
create_task
人声分离与分轨
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "suno_separate_vocals",
"input": {
"type": "separate_vocal",
"upload_url": "https://example.com/song.mp3"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno_separate_vocals',
input: {type: 'separate_vocal', upload_url: 'https://example.com/song.mp3'}
})
};
fetch('https://apistable.ai/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.ai/api/v1/tasks/create_task"
payload = {
"model": "suno_separate_vocals",
"input": {
"type": "separate_vocal",
"upload_url": "https://example.com/song.mp3"
}
}
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 且不创建任务;音乐积分扣除当前未启用。
调用步骤
工具箱模式填写音频 URL;原生分轨选择本站歌曲 ID,按返回轨道分别试听和下载。-
- 按下方示例准备输入,将占位地址和 ID 换成你有权使用的资源。
-
- 将 model 设为 suno_separate_vocals,参数放在 input 内。提交一次并保存返回的 task_id。
-
- 查询已保存的任务,或接收回调。任务仍在处理中时继续等待,不重新提交同一操作。
- 遍历 result.stems,读取各轨的 download_url 和到期时间,以实际返回的轨名和数量为准。
创建任务
将model和input发送到统一任务入口;可在顶层传公开HTTPS callback_url。资源ID均为本账户的本站ID。当前音乐积分扣除未启用。{
"model": "suno_separate_vocals",
"input": {
"type": "separate_vocal",
"upload_url": "https://example.com/song.mp3"
}
}
受理响应
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"
}
}
参数:type = separate_vocal
| 字段 | 类型 | 必填 | 说明与限制 |
|---|---|---|---|
| type | string | 是 | separate_vocal(2 轨)、split_stem(4/6 轨),或原生 split_stem_advanced。 = separate_vocal |
| upload_url | string | 是 | 公开HTTPS音频URL,端口443且不含用户名密码。接受包含可读音轨的MP3/WAV/FLAC/OGG/M4A/AAC,大小限制见具体操作。 |
| output_format | string | 否 / 依条件 | 工具箱输出:mp3、wav(默认)、flac、ogg、m4a 或 aac;原生轨道抽取不接受此参数。 values: mp3, wav, flac, ogg, m4a, aac; default: wav |
参数:type = split_stem
| 字段 | 类型 | 必填 | 说明与限制 |
|---|---|---|---|
| type | string | 是 | separate_vocal(2 轨)、split_stem(4/6 轨),或原生 split_stem_advanced。 = split_stem |
| upload_url | string | 是 | 公开HTTPS音频URL,端口443且不含用户名密码。接受包含可读音轨的MP3/WAV/FLAC/OGG/M4A/AAC,大小限制见具体操作。 |
| stem_mode | number | 是 | 工具箱分轨:4 或 6 轨;人声分离在后台固定为 2 轨。 values: 4, 6 |
| output_format | string | 否 / 依条件 | 工具箱输出:mp3、wav(默认)、flac、ogg、m4a 或 aac;原生轨道抽取不接受此参数。 values: mp3, wav, flac, ogg, m4a, aac; default: wav |
参数:type = split_stem_advanced
| 字段 | 类型 | 必填 | 说明与限制 |
|---|---|---|---|
| type | string | 是 | separate_vocal(2 轨)、split_stem(4/6 轨),或原生 split_stem_advanced。 = split_stem_advanced |
| audio_id | string | 是 | 本账户的本站歌曲ID。翻唱/续写只传此ID,不传源task_id或外部URL。 maxLength: 200 |
| stem_name | string | 否 / 依条件 | 原生抽取的轨道名。当前仅 Piano 有明确文档并开放;省略时使用十二轨分离。 maxLength: 100 |
输入与限制
下方Schema列出支持字段、类型和基础限制;还须遵守“重要条件”,跨字段与来源资源校验不完全体现在JSON Schema中。未知参数会被拒绝。URL 参数仅接受公开 HTTPS 地址,不接受文件对象。{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "separate_vocal",
"description": "separate_vocal(2 轨)、split_stem(4/6 轨),或原生 split_stem_advanced。"
},
"upload_url": {
"type": "string",
"format": "uri",
"description": "公开HTTPS音频URL,端口443且不含用户名密码。接受包含可读音轨的MP3/WAV/FLAC/OGG/M4A/AAC,大小限制见具体操作。"
},
"output_format": {
"default": "wav",
"type": "string",
"enum": [
"mp3",
"wav",
"flac",
"ogg",
"m4a",
"aac"
],
"description": "工具箱输出:mp3、wav(默认)、flac、ogg、m4a 或 aac;原生轨道抽取不接受此参数。"
}
},
"required": [
"type",
"upload_url"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "split_stem",
"description": "separate_vocal(2 轨)、split_stem(4/6 轨),或原生 split_stem_advanced。"
},
"upload_url": {
"type": "string",
"format": "uri",
"description": "公开HTTPS音频URL,端口443且不含用户名密码。接受包含可读音轨的MP3/WAV/FLAC/OGG/M4A/AAC,大小限制见具体操作。"
},
"stem_mode": {
"anyOf": [
{
"type": "number",
"const": 4
},
{
"type": "number",
"const": 6
}
],
"description": "工具箱分轨:4 或 6 轨;人声分离在后台固定为 2 轨。"
},
"output_format": {
"default": "wav",
"type": "string",
"enum": [
"mp3",
"wav",
"flac",
"ogg",
"m4a",
"aac"
],
"description": "工具箱输出:mp3、wav(默认)、flac、ogg、m4a 或 aac;原生轨道抽取不接受此参数。"
}
},
"required": [
"type",
"upload_url",
"stem_mode"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "split_stem_advanced",
"description": "separate_vocal(2 轨)、split_stem(4/6 轨),或原生 split_stem_advanced。"
},
"audio_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "本账户的本站歌曲ID。翻唱/续写只传此ID,不传源task_id或外部URL。"
},
"stem_name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "原生抽取的轨道名。当前仅 Piano 有明确文档并开放;省略时使用十二轨分离。"
}
},
"required": [
"type",
"audio_id"
],
"additionalProperties": false
}
]
}
重要条件
- separate_vocal与split_stem使用upload_url,音频上限100 MiB。separate_vocal请求两轨;split_stem必须传stem_mode=4或6。output_format使用所列格式,默认wav。
- 原生split_stem_advanced传audio_id,不传upload_url或output_format;省略stem_name为十二轨分离,单轨抽取当前仅开放Piano,其他名称返回42201。结果可能包含多组轨道,请遍历实际stems数组,不假定固定条数。
- 音频URL必须包含可读且时长大于零的MP3/WAV/FLAC/OGG/M4A/AAC音轨,每个文件最多100 MiB。URL须为可公开读取的HTTPS地址、端口443,不含用户名密码或私网地址,且应持续可访问直到任务结束。
- 上传文件保留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": [
"stems"
],
"properties": {
"stems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"stem_name": {
"type": [
"string",
"null"
]
},
"download_url": {
"type": "string"
},
"expires_at": {
"type": "string"
}
}
}
}
},
"additionalProperties": false
}
相关流程
Voice 完整四步 文件上传 回调授权
Every valid key can submit and query its own account. Revoked keys are rejected.
请求体
application/json