curl --request POST \
--url https://api.wizzx.ai/api/v1/music/{action} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom": true,
"prompt": "[Verse]\nNeon-lit streets on a rainy night",
"title": "Midnight Drive",
"style": "synthwave, female vocal"
}
'{
"code": 0,
"message": "success",
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_key": "<string>",
"credits_deducted": 1,
"action": "<string>",
"provider_task_id": "<string>",
"provider_key": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}提交音乐动作
POST 一个 Suno 音乐动作:创作、续写、编辑、分轨、分析或导出曲目
curl --request POST \
--url https://api.wizzx.ai/api/v1/music/{action} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom": true,
"prompt": "[Verse]\nNeon-lit streets on a rainy night",
"title": "Midnight Drive",
"style": "synthwave, female vocal"
}
'{
"code": 0,
"message": "success",
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_key": "<string>",
"credits_deducted": 1,
"action": "<string>",
"provider_task_id": "<string>",
"provider_key": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "<string>"
},
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_after": 1
}概览
POST /api/v1/music/{action} 是 Suno 音乐的主入口,路径中的 action 为 33 个动作之一。每个动作都会创建一个 suno 模型的异步任务:保存 data.task_id,再通过 POST /api/v1/task/status 查询直到任务结束。每次调用计费一次,各动作积分见 Suno 计费。
POST /api/v1/task/submit/suno 仍然可用,等同于 generate 动作。
curl --fail-with-body --silent --show-error \
-X POST https://api.wizzx.ai/api/v1/music/generate \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
--data '{
"custom": true,
"prompt": "[Verse]\n雨夜里霓虹闪烁的街道",
"title": "Midnight Drive",
"style": "synthwave, female vocal"
}'
action:
{
"code": 0,
"message": "success",
"data": {
"task_id": "6f0c1c52-2a4b-4d53-9a5e-3c0f2f7d9e11",
"model_key": "suno",
"action": "generate",
"credits_deducted": 60
},
"request_id": "0d9d7b8e-51f6-4a1e-8d0e-9b7c2a6f4c33"
}
通用规则
- 严格字段。 每个动作只接受下文为它列出的字段。传入该动作不接受的音乐字段会返回 HTTP 422
validation_failed,例如music action bpm does not accept version。不需要的字段请直接省略。 - 未知动作返回 HTTP 404
music_action_not_found。 - 文本长度按 Unicode 字符计算。音频 URL 必须是公网可访问的 HTTP(S) 地址,最多 2,048 个字符。
- 之前的任务只能通过 Wizzx
task_id引用,见下方「引用已有任务」。 - 音乐动作与提交接口共用限流。参数校验和来源任务校验失败时,不会预扣任何积分。
通用字段
以下字段在所有接受它们的动作中含义相同。| 字段 | 类型 | 规则 |
|---|---|---|
prompt | string | 自定义模式下为歌词,最多 5,000 个字符。generate 灵感模式的歌曲描述、lyrics 的主题与 sounds 的音效描述最多 3,000 个字符 |
gpt_description | string | generate 以外动作在灵感模式(custom: false)下的歌曲描述,最多 3,000 个字符 |
custom | boolean | 自定义(歌词)模式开关,见下方「自定义模式与灵感模式」 |
instrumental | boolean | true 表示无人声。不能与 vocal_gender 同时使用 |
version | string | v6(默认)、v6-wild 或 v6-mini,不区分大小写,价格相同 |
custom_model_task_id | string | 你已完成的 create-model 任务的 task_id。用于替代 version;不能与 version 或 persona_task_id 同时使用 |
persona_task_id | string | 你已完成的 persona 或 create-voice 任务的 task_id。仅自定义模式 |
title | string | 最多 80 个字符 |
style | string | 风格标签,最多 1,000 个字符 |
negative_tags | string | 需要避开的风格,最多 1,000 个字符 |
style_weight、weirdness、audio_weight | number | 0–1;0 是有效值 |
vocal_gender | string | Male 或 Female(也接受 m、f)。不能与 instrumental: true 同时使用 |
auto_lyrics | boolean | 仅自定义模式 |
variety | string | off、normal、high、extra 或 max |
max_mode | boolean | 更高质量,价格翻倍。在有模式开关的动作上需要自定义模式 |
audio_format | string | mp3、m4a 或 wav |
duration | integer | 目标时长 10–360 秒,实际时长可能不同;不影响价格 |
task_id | string | 来源任务,见下方「引用已有任务」 |
audio_index | integer | 1–20,默认 1:来源曲目的 result.tracks[].index |
- 模型选择:
version或custom_model_task_id - 风格字段:
title、style、negative_tags - 权重:
style_weight、weirdness、audio_weight - 模式字段:
custom、prompt、gpt_description
自定义模式与灵感模式
部分动作可以在自定义模式(自己写歌词和风格)与灵感模式(由 Suno 根据描述创作)之间切换。| 动作 | 模式如何确定 |
|---|---|
generate | custom 默认 false。灵感模式:prompt 为必填的歌曲描述。自定义模式:prompt 为歌词,除非 instrumental 为 true,否则必填;自定义纯音乐需要 prompt 或 style |
upload-cover | custom 必填。false 需要 gpt_description;true 需要 prompt,除非 instrumental 为 true |
extend | custom 默认 true。false 需要 gpt_description |
cover、add-vocals、add-instrumental、add-stem、mashup、sample | 省略 custom 时自动推断:有 prompt 视为自定义;否则有 gpt_description 视为灵感;否则有 style 或 title 视为自定义;都没有则返回 422。mashup 与 sample 在自定义模式下需要 prompt,除非 instrumental 为 true |
upload-extend | 始终为自定义模式,没有 custom 字段 |
generate 拒绝 title、style、negative_tags、auto_lyrics、persona_task_id、duration 与 max_mode;其他动作拒绝 prompt、title、style、negative_tags、auto_lyrics、persona_task_id、duration、max_mode、style_weight 与 audio_weight。自定义模式下拒绝 gpt_description。
引用已有任务
许多动作基于你已经生成的曲目:task_id+audio_index选择一首曲目。audio_index是该曲目在来源任务result.tracks中从 1 开始的index,默认1。mashup改用task_ids(正好两个任务)与audio_indexes(两个元素,默认[1, 1])。custom_model_task_id必须指向已完成的create-model任务,persona_task_id必须指向已完成的persona或create-voice任务。
SUCCEEDED 的 suno 任务。只有产出曲目的动作才能作为曲目来源:generate、inspo、sounds、upload、upload-cover、upload-extend、extend、cover、remaster、stems、stems-all、add-vocals、add-instrumental、add-stem、replace-section、remove-section、crop、fade-in、fade-out、adjust-speed、concat、mashup 与 sample。歌词、风格、分析、Persona、模型、声音、视频与下载结果不能作为来源。
部分动作要求特定类型的来源:
| 动作 | 来源任务必须是 |
|---|---|
add-vocals、add-instrumental、sample | upload 任务 |
concat | extend 任务 |
audio_index 在来源任务中存在,且 continue_at、end_s、fade_duration 不超出来源曲目时长。任一检查失败都会返回 HTTP 422,不会预扣积分。
result 对象。它们仍可作为来源,但无法提前校验曲目序号与时间;超出范围的值会导致任务失败,积分会退回。动作
所有动作的输出都在任务状态的result 对象中返回。
创作
| 动作 | 必填 | 可选 | 结果 |
|---|---|---|---|
generate | prompt(自定义模式纯音乐除外,见模式规则) | custom、instrumental、模型选择、persona_task_id、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format、duration | tracks,通常两首 |
inspo | audio_urls:1–4 个公网参考音频 URL | prompt(歌词)、模型选择、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format | tracks |
sounds | prompt:音效描述 | version、sound_type(one-shot 或 loop)、bpm(整数 1–300)、key(C 到 B,升号写法如 F#,小调加 m 如 C#m)、audio_format | tracks |
lyrics | prompt:主题 | lyrics_model(classic 或 remi) | lyrics |
upsample-tags | style | – | style(增强后) |
upload | audio_url | – | tracks;曲目可能没有 audio_url。该任务可作为 add-vocals、add-instrumental、sample 的来源 |
upload-cover | audio_url(短于 8 分钟)、custom | 模式字段、instrumental、模型选择、persona_task_id、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format、duration | tracks |
upload-extend | audio_url、continue_at(至少 1 秒) | prompt(歌词)、模型选择、persona_task_id、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format、duration | tracks |
create-model | name(最多 80 个字符)、audio_urls:6–24 个公网音频 URL | – | model_id。把本任务的 task_id 作为 custom_model_task_id 使用。可能需要约 20 分钟 |
create-voice | audio_url(MP3 或 WAV):不带伴奏的干净人声录音 | – | persona_id;把本任务的 task_id 作为 persona_task_id 使用 |
基于已有曲目
除特别说明外,以下动作都接受task_id(必填)与 audio_index(可选)。
| 动作 | 除 task_id 外必填 | 可选 | 来源 | 结果 |
|---|---|---|---|---|
extend | continue_at:至少 1 秒且小于曲目时长 | 模式字段(custom 默认 true)、模型选择、persona_task_id、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format、duration | 任意曲目 | tracks |
concat | – | audio_format | extend 任务 | tracks:拼接后的完整歌曲 |
cover | 模式(自动推断,见模式规则) | 模式字段、模型选择、persona_task_id、风格字段、权重、vocal_gender、variety、max_mode、audio_format、duration | 任意曲目 | tracks |
remaster | – | variation_category(subtle、normal 或 high)、audio_format | 任意曲目 | tracks |
add-vocals | 模式(自动推断,见模式规则) | 模式字段、模型选择、风格字段、权重、vocal_gender、variety、max_mode、audio_format | upload 任务 | tracks |
add-instrumental | 模式(自动推断,见模式规则) | 与 add-vocals 相同 | upload 任务 | tracks |
add-stem | 模式(自动推断,见模式规则) | 模式字段、模型选择、风格字段、权重、variety、max_mode、audio_format | 任意曲目 | tracks |
mashup | task_ids:正好两个任务,替代 task_id;模式(自动推断) | audio_indexes(两个元素,默认 [1, 1])、模式字段、instrumental、模型选择、persona_task_id、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format | 两首曲目 | tracks |
sample | start_s、end_s;模式(自动推断) | 模式字段、instrumental、模型选择、风格字段、权重、vocal_gender、auto_lyrics、variety、max_mode、audio_format | upload 任务 | tracks |
persona | name(最多 80 个字符) | description(最多 1,000 个字符)、style、start_s / end_s(人声片段) | 任意曲目 | persona_id。把本任务的 task_id 作为 persona_task_id 使用 |
编辑
所有编辑动作都接受task_id(必填)与 audio_index(可选),来源可以是任意曲目。
| 动作 | 除 task_id 外必填 | 可选 | 结果 |
|---|---|---|---|
replace-section | start_s、end_s | infill_lyrics(该段的新歌词,最多 5,000 个字符)、prompt(上下文歌词)、模型选择、风格字段、variety、max_mode、audio_format | tracks |
remove-section | start_s、end_s | – | tracks |
crop | start_s、end_s:要保留的部分 | – | tracks |
fade-in、fade-out | fade_duration:大于 0 且不超过曲目时长 | title | tracks |
adjust-speed | speed:0.25–4 | keep_pitch(默认 true)、title | tracks |
stems | – | stem_type(默认 lead_vocal;90 多个可选值,如 drum_kit、bass、piano、808,完整列表见 API Schema)、audio_format | tracks |
stems-all | – | audio_format | tracks,每个分轨一首 |
0 ≤ start_s < end_s ≤ 曲目时长。
分析与导出
以下动作接受task_id(必填)与 audio_index(可选),来源可以是任意曲目。
| 动作 | 除 task_id 外必填 | 结果 |
|---|---|---|
midi | – | midi |
aligned-lyrics | – | aligned_lyrics:带时间轴的歌词 |
bpm | – | bpm:{avg, min, max} |
music-video | – | video_url:MP4 |
download | formats:mp3、m4a、wav 中的一个或多个,重复值会被忽略 | files |
完整示例
每一步都是单独计费的任务。被引用的任务必须先变为SUCCEEDED。
生成、续写并拼接为完整歌曲
第 1 步。 用POST /api/v1/music/generate 生成:
{
"custom": true,
"prompt": "[Verse]\n雨夜里霓虹闪烁的街道",
"title": "Midnight Drive",
"style": "synthwave, female vocal"
}
result.tracks 中选一首,例如 "index": 2 的曲目。
第 2 步。 用 POST /api/v1/music/extend 从 1:30 处续写该曲目:
{
"task_id": "6f0c1c52-2a4b-4d53-9a5e-3c0f2f7d9e11",
"audio_index": 2,
"continue_at": 90,
"prompt": "[Bridge]\n城市在身后渐渐远去"
}
POST /api/v1/music/concat 并传入 extend 任务的 task_id,拼接为完整歌曲:
{
"task_id": "8a1d2e44-5b6c-4f70-8e91-a2b3c4d5e6f7"
}
给自己的音频加人声
第 1 步。 用POST /api/v1/music/upload 上传音频:
{
"audio_url": "https://example.com/beat.mp3"
}
POST /api/v1/music/add-vocals 并传入 upload 任务的 task_id:
{
"task_id": "3c9e7f10-2d4b-4a8e-9f61-7b2c1d0e5a94",
"prompt": "[Verse]\n清晨的光洒在空荡的街",
"style": "soul, female vocal"
}
分轨与下载文件
用POST /api/v1/music/stems 从已完成的歌曲中提取一个分轨:
{
"task_id": "6f0c1c52-2a4b-4d53-9a5e-3c0f2f7d9e11",
"stem_type": "drum_kit"
}
stems-all 可把曲目拆成全部分轨。需要曲目的 WAV 与 MP3 文件时,调用 POST /api/v1/music/download:
{
"task_id": "6f0c1c52-2a4b-4d53-9a5e-3c0f2f7d9e11",
"formats": ["wav", "mp3"]
}
result.files 中。
错误
| HTTP | 含义 |
|---|---|
| 402 | 积分不足 |
| 404 | music_action_not_found:未知动作 |
| 422 | validation_failed:动作不接受的字段、违反模式规则、长度/范围/枚举不合法,或来源任务不可用(不存在、不属于你、未完成、动作类型不符、序号或时间超出范围) |
| 429 | 触发限流 |
| 503 | model_unavailable:Suno 暂不接受新任务 |
授权
Wizzx API key. This is not a JWT.
路径参数
Music action. Unknown actions return 404 music_action_not_found.
generate, inspo, sounds, lyrics, upsample-tags, upload, upload-cover, upload-extend, create-model, create-voice, extend, concat, cover, remaster, add-vocals, add-instrumental, add-stem, mashup, sample, persona, replace-section, remove-section, crop, fade-in, fade-out, adjust-speed, stems, stems-all, midi, aligned-lyrics, bpm, music-video, download 请求体
Request body for POST /api/v1/music/{action}. Each action accepts only its own fields, listed per action in x-wizzx-music-actions; sending a field the action does not accept returns 422. Earlier tasks are referenced by Wizzx task_id only and must be your own SUCCEEDED suno tasks.
Lyrics in custom mode (at most 5000 characters). A description (at most 3000 characters) for generate inspiration mode, the lyrics topic, and the sounds description.
5000Song description for inspiration mode (custom=false) on actions other than generate.
3000Custom (lyrics) mode. generate defaults to false; extend defaults to true; upload-cover requires it; cover, add-vocals, add-instrumental, add-stem, mashup, and sample infer it when omitted (prompt, style, or title means true; gpt_description means false).
No vocals. Cannot be combined with vocal_gender.
Case-insensitive. All versions cost the same. Cannot be combined with custom_model_task_id.
v6, v6-wild, v6-mini task_id of your SUCCEEDED create-model task. Replaces version; cannot be combined with version or persona_task_id.
task_id of your SUCCEEDED persona or create-voice task. Custom mode only.
Custom mode only on actions with a mode switch.
80Style tags. Custom mode only on actions with a mode switch. Required by upsample-tags.
1000Styles to avoid. Custom mode only on actions with a mode switch.
1000How strongly to follow style, 0-1. Custom mode only on actions other than generate.
0 <= x <= 1How experimental the result is, 0-1.
0 <= x <= 1How closely to follow the source audio, 0-1. Custom mode only on actions other than generate.
0 <= x <= 1Case-insensitive; m and f are accepted. Cannot be combined with instrumental=true.
Male, Female Custom mode only.
off, normal, high, extra, max Higher quality at double the price. Requires custom mode on actions with a mode switch.
mp3, m4a, wav Target length in seconds; actual length may differ. Custom mode only on actions with a mode switch. Does not change the price.
10 <= x <= 360Source task: one of your SUCCEEDED suno tasks that produced tracks.
1-based result.tracks[].index of the source task.
1 <= x <= 20mashup: exactly two source tasks.
2 elementsmashup: track index for each task_ids entry.
2 elements1 <= x <= 20Publicly reachable HTTP(S) audio URL, at most 2048 characters.
2048^https?://inspo: 1-4 reference audio URLs. create-model: 6-24 training audio URLs.
1 - 24 elementsPublicly reachable HTTP(S) audio URL, at most 2048 characters.
2048^https?://Seconds into the source audio where the continuation starts. For extend it must be less than the source track duration.
x >= 1Section start in seconds.
x >= 0Section end in seconds. Greater than start_s and not beyond the source track duration.
x > 0Fade length in seconds; not longer than the source track.
x > 00.25 <= x <= 4Case-insensitive.
lead_vocal, drum_kit, bass, backing_vocals, piano, electric_guitar, percussion, string_section, synth, acoustic_guitar, sound_effects, synth_pad, synth_bass, guitar, brass_section, organ, electronic_drum_kit, lead_electric_guitar, synth_keys, rhythm_electric_guitar, electric_piano, upright_bass, keyboards, distorted_electric_guitar, kick, snare, risers, synth_strings, synth_lead, woodwinds, flute, harp, tambourine, trumpet, arpeggiator, accordion, fiddle, pedal_steel_guitar, synth_voice, violin, digital_piano, synth_brass, mandolin, choir, banjo, bells, clarinet, tenor_saxophone, trombone, shaker, french_horn, glockenspiel, electric_bass, cello, timpani, harmonica, marimba, vibraphone, lap_steel_guitar, saxophone, orchestra, horns, cymbals, hand_clap, oboe, celesta, congas, drone, alto_saxophone, double_bass, ukulele, harpsichord, baritone_saxophone, xylophone, tuba, bass_guitar, whistle, lead_guitar, rhodes, 808, bongos, bassoon, cowbell, viola, sitar, steel_drums, piccolo, theremin, bagpipes, hi_hat, music_box, melodica, tabla, koto, djembe, taiko, didgeridoo replace-section: lyrics for the replaced section.
5000subtle, normal, high one-shot, loop 1 <= x <= 300Sharp notation; append m for minor.
C, Cm, C#, C#m, D, Dm, D#, D#m, E, Em, F, Fm, F#, F#m, G, Gm, G#, G#m, A, Am, A#, A#m, B, Bm classic, remi create-model or persona name.
80persona description.
1000Duplicates are ignored.
1mp3, m4a, wav 此页面对您有帮助吗?
