歌曲生成接口
开发中
正式环境(默认全球加速)
https://api.sunohub.cn
正式环境(默认全球加速)
https://api.sunohub.cn
POST
https://api.sunohub.cn
最后修改时间:2025-07-01 07:49:06
请求参数
Header 参数
Authorization
string
用户的使用凭证
示例值:
Bearer {{API_TOKEN}}
Body 参数application/json
action
string
必需
示例值:
generateextendupload_generateconcatreplace_sectionupload_extendstemsartist_consistencycover
prompt
string
生成歌曲的提示词
model
string
采用的模型
示例值:
chirp-v4-5chirp-v3-5chirp-v4
custom
boolean
是否自定义生成
instrumental
boolean
是否纯音乐
audio_id
string
可选
audio_url
string
必需
continue_at
integer
继续生成的起点时间
style
string
生成歌曲的风格
lyric
string
可选
is_pro
boolean
可选
默认值:
false
style_negative
string
排除的风格
persona_id
string
必需
示例
{
"action": "generate",
"prompt": "A song for Christmas",
"model": "chirp-v4",
"custom": false,
"instrumental": false
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.sunohub.cn/suno/audios' \
--header 'Authorization: Bearer asdasdasda9998fads' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"action": "generate",
"prompt": "A song for Christmas",
"model": "chirp-v4",
"custom": false,
"instrumental": false
}'
返回响应
🟢200成功
application/json
Body
success
boolean
必需
data
array [object {11}]
必需
state
string
必需
id
string
必需
title
string
必需
image_url
string
必需
lyric
string
必需
audio_url
string
必需
video_url
string
必需
created_at
string
必需
model
string
必需
prompt
string
必需
style
string
必需
示例
{
"success": true,
"data": [
{
"state": "succeeded",
"id": "2f16f7bc-4135-42c6-b3c5-6d6c49dc8cd5",
"title": "Winter Wonderland",
"image_url": "https://cdn1.suno.ai/image_2f16f7bc-4135-42c6-b3c5-6d6c49dc8cd5.png",
"lyric": "[Verse]\nSnowflakes falling all around\nGlistening white\nCovering the ground\nChildren laughing\nFull of delight\nIn this winter wonderland tonight\nSanta's sleigh\nUp in the sky\nRudolph's nose shining bright\nOh my\nHear the jingle bells\nRinging so clear\nBringing joy and holiday cheer\n[Verse 2]\nRoasting chestnuts by the fire's glow\nChristmas lights\nThey twinkle and show\nFamilies gathering with love and cheer\nSpreading warmth to everyone near",
"audio_url": "https://cdn1.suno.ai/2f16f7bc-4135-42c6-b3c5-6d6c49dc8cd5.mp3",
"video_url": "https://cdn1.suno.ai/2f16f7bc-4135-42c6-b3c5-6d6c49dc8cd5.mp4",
"created_at": "2024-05-10T16:21:37.624Z",
"model": "chirp-v3",
"prompt": "A song for Christmas",
"style": "holiday"
},
{
"state": "succeeded",
"id": "5dca232b-17cc-4896-a2d1-4b59178bf410",
"title": "Winter Wonderland",
"image_url": "https://cdn1.suno.ai/image_5dca232b-17cc-4896-a2d1-4b59178bf410.png",
"lyric": "[Verse]\nSnowflakes falling all around\nGlistening white\nCovering the ground\nChildren laughing\nFull of delight\nIn this winter wonderland tonight\nSanta's sleigh\nUp in the sky\nRudolph's nose shining bright\nOh my\nHear the jingle bells\nRinging so clear\nBringing joy and holiday cheer\n[Verse 2]\nRoasting chestnuts by the fire's glow\nChristmas lights\nThey twinkle and show\nFamilies gathering with love and cheer\nSpreading warmth to everyone near",
"audio_url": "https://cdn1.suno.ai/5dca232b-17cc-4896-a2d1-4b59178bf410.mp3",
"video_url": "https://cdn1.suno.ai/5dca232b-17cc-4896-a2d1-4b59178bf410.mp4",
"created_at": "2024-05-10T16:21:37.624Z",
"model": "chirp-v3",
"prompt": "A song for Christmas",
"style": "holiday"
}
]
}
🟢200异步回调结果
修改于 2025-07-01 07:49:06