根据歌曲创建 Persona
curl --request POST \
--url https://apistable.com/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "suno_persona_create",
"input": {
"persona_model": "style_persona",
"audio_id": "YOUR_AUDIO_ID",
"name": "My style"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno_persona_create',
input: {persona_model: 'style_persona', audio_id: 'YOUR_AUDIO_ID', name: 'My style'}
})
};
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_persona_create",
"input": {
"persona_model": "style_persona",
"audio_id": "YOUR_AUDIO_ID",
"name": "My style"
}
}
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
根据歌曲创建 Persona
风格 Persona 直接使用歌曲 ID;声音 Persona 使用预处理后的素材 ID 与选段。
POST
/
api
/
v1
/
tasks
/
create_task
根据歌曲创建 Persona
curl --request POST \
--url https://apistable.com/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "suno_persona_create",
"input": {
"persona_model": "style_persona",
"audio_id": "YOUR_AUDIO_ID",
"name": "My style"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno_persona_create',
input: {persona_model: 'style_persona', audio_id: 'YOUR_AUDIO_ID', name: 'My style'}
})
};
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_persona_create",
"input": {
"persona_model": "style_persona",
"audio_id": "YOUR_AUDIO_ID",
"name": "My style"
}
}
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 且不创建任务;音乐积分扣除当前未启用。
调用步骤
风格 Persona 直接使用歌曲 ID;声音 Persona 使用预处理后的素材 ID 与选段。-
- 按下方示例准备输入,将占位地址和 ID 换成你有权使用的资源。
-
- 将 model 设为 suno_persona_create,参数放在 input 内。提交一次并保存返回的 task_id。
-
- 查询已保存的任务,或接收回调。任务仍在处理中时继续等待,不重新提交同一操作。
- 一并保存 result.persona_id 和 persona_model,传给支持该 Persona 类型的生成操作。
创建任务
将model和input发送到统一任务入口;可在顶层传公开HTTPS callback_url。资源ID均为本账户的本站ID。当前音乐积分扣除未启用。{
"model": "suno_persona_create",
"input": {
"persona_model": "style_persona",
"audio_id": "YOUR_AUDIO_ID",
"name": "My style"
}
}
受理响应
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"
}
}
参数:persona_model = style_persona
| 字段 | 类型 | 必填 | 说明与限制 |
|---|---|---|---|
| persona_model | string | 是 | style_persona 或 voice_persona,须与资源真实来源匹配。 = style_persona |
| audio_id | string | 是 | 本账户的本站歌曲ID。翻唱/续写只传此ID,不传源task_id或外部URL。 maxLength: 200 |
| source_audio_ids | array | 否 / 依条件 | 可选 Persona 参考歌曲的本站 audio_id 数组,省略使用原曲;只接受本站原创生成歌曲。 minItems: 1 |
| image_url | string | 否 / 依条件 | 可选公开HTTPS封面图片:JPEG/PNG/WebP/BMP,最多10 MiB。 |
| name | string | 是 | Voice 或 Persona 展示名称。 maxLength: 100 |
| description | string | 否 / 依条件 | Voice 或 Persona 描述。 maxLength: 1000 |
参数:persona_model = voice_persona
| 字段 | 类型 | 必填 | 说明与限制 |
|---|---|---|---|
| persona_model | string | 是 | style_persona 或 voice_persona,须与资源真实来源匹配。 = voice_persona |
| prepared_audio_id | string | 是 | suno_persona_prepare 返回的本站预处理人声 ID。 maxLength: 200 |
| name | string | 是 | Voice 或 Persona 展示名称。 maxLength: 100 |
| description | string | 否 / 依条件 | Voice 或 Persona 描述。 maxLength: 1000 |
| vocal_start_s | number | 是 | 选中人声开始位置(秒),最多两位小数。Voice上传使用原始录音时间轴,歌曲Persona使用预处理人声时间轴。 min: 0 |
| vocal_end_s | number | 是 | 选中人声结束位置(秒),最多两位小数;须大于开始位置且不超出音频时长。歌曲声音Persona需选择10–30秒。 min: 0 |
| user_input_styles | string | 否 / 依条件 | 歌曲声音 Persona 的可选风格描述。 maxLength: 1000 |
输入与限制
下方Schema列出支持字段、类型和基础限制;还须遵守“重要条件”,跨字段与来源资源校验不完全体现在JSON Schema中。未知参数会被拒绝。URL 参数仅接受公开 HTTPS 地址,不接受文件对象。{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"oneOf": [
{
"type": "object",
"properties": {
"persona_model": {
"type": "string",
"const": "style_persona",
"description": "style_persona 或 voice_persona,须与资源真实来源匹配。"
},
"audio_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "本账户的本站歌曲ID。翻唱/续写只传此ID,不传源task_id或外部URL。"
},
"source_audio_ids": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "APIstable resource ID; never a supplier ID."
},
"description": "可选 Persona 参考歌曲的本站 audio_id 数组,省略使用原曲;只接受本站原创生成歌曲。"
},
"image_url": {
"type": "string",
"format": "uri",
"description": "可选公开HTTPS封面图片:JPEG/PNG/WebP/BMP,最多10 MiB。"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "Voice 或 Persona 展示名称。"
},
"description": {
"type": "string",
"maxLength": 1000,
"description": "Voice 或 Persona 描述。"
}
},
"required": [
"persona_model",
"audio_id",
"name"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"persona_model": {
"type": "string",
"const": "voice_persona",
"description": "style_persona 或 voice_persona,须与资源真实来源匹配。"
},
"prepared_audio_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "suno_persona_prepare 返回的本站预处理人声 ID。"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "Voice 或 Persona 展示名称。"
},
"description": {
"type": "string",
"maxLength": 1000,
"description": "Voice 或 Persona 描述。"
},
"vocal_start_s": {
"type": "number",
"minimum": 0,
"description": "选中人声开始位置(秒),最多两位小数。Voice上传使用原始录音时间轴,歌曲Persona使用预处理人声时间轴。"
},
"vocal_end_s": {
"type": "number",
"minimum": 0,
"description": "选中人声结束位置(秒),最多两位小数;须大于开始位置且不超出音频时长。歌曲声音Persona需选择10–30秒。"
},
"user_input_styles": {
"type": "string",
"maxLength": 1000,
"description": "歌曲声音 Persona 的可选风格描述。"
}
},
"required": [
"persona_model",
"prepared_audio_id",
"name",
"vocal_start_s",
"vocal_end_s"
],
"additionalProperties": false
}
]
}
重要条件
- 风格Persona必填audio_id;可选source_audio_ids只能引用生成歌曲,上传音频及其衍生作品会被拒绝。提供source_audio_ids时,该列表替代默认单首来源,不是追加;可选封面为JPEG/PNG/WebP/BMP,最多10 MiB。
- 声音Persona必填未过期的prepared_audio_id;须在预处理人声时间轴内选择10–30秒,起止位置最多两位小数。只传所选persona_model分支的字段。
- 上传文件保留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": [
"persona_id",
"persona_model",
"name",
"description"
],
"properties": {
"persona_id": {
"type": "string"
},
"persona_model": {
"enum": [
"style_persona",
"voice_persona"
]
},
"name": {
"type": "string"
},
"description": {
"type": "string"
}
},
"additionalProperties": false
}
相关流程
Voice 完整四步 文件上传 回调授权
Every valid key can submit and query its own account. Revoked keys are rejected.
请求体
application/json