cURL
curl --request POST \
--url https://api.ttapi.io/suno/v1/music \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"custom": true,
"instrumental": false,
"mv": "chirp-v6",
"prompt": "<string>",
"title": "<string>",
"tags": "rock, blues, hip-hop, r&b",
"negative_tags": "<string>",
"style_weight": 0.5,
"weirdness_constraint": 0.5,
"audio_weight": 0.5,
"auto_lyrics": false,
"duration": 120,
"persona_id": "<string>",
"variety": "normal",
"max_mode": false,
"audio_format": "mp3",
"hookUrl": "<string>",
"isStorage": true
}
'import requests
url = "https://api.ttapi.io/suno/v1/music"
payload = {
"custom": True,
"instrumental": False,
"mv": "chirp-v6",
"prompt": "<string>",
"title": "<string>",
"tags": "rock, blues, hip-hop, r&b",
"negative_tags": "<string>",
"style_weight": 0.5,
"weirdness_constraint": 0.5,
"audio_weight": 0.5,
"auto_lyrics": False,
"duration": 120,
"persona_id": "<string>",
"variety": "normal",
"max_mode": False,
"audio_format": "mp3",
"hookUrl": "<string>",
"isStorage": True
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom: true,
instrumental: false,
mv: 'chirp-v6',
prompt: '<string>',
title: '<string>',
tags: 'rock, blues, hip-hop, r&b',
negative_tags: '<string>',
style_weight: 0.5,
weirdness_constraint: 0.5,
audio_weight: 0.5,
auto_lyrics: false,
duration: 120,
persona_id: '<string>',
variety: 'normal',
max_mode: false,
audio_format: 'mp3',
hookUrl: '<string>',
isStorage: true
})
};
fetch('https://api.ttapi.io/suno/v1/music', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ttapi.io/suno/v1/music",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'custom' => true,
'instrumental' => false,
'mv' => 'chirp-v6',
'prompt' => '<string>',
'title' => '<string>',
'tags' => 'rock, blues, hip-hop, r&b',
'negative_tags' => '<string>',
'style_weight' => 0.5,
'weirdness_constraint' => 0.5,
'audio_weight' => 0.5,
'auto_lyrics' => false,
'duration' => 120,
'persona_id' => '<string>',
'variety' => 'normal',
'max_mode' => false,
'audio_format' => 'mp3',
'hookUrl' => '<string>',
'isStorage' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ttapi.io/suno/v1/music"
payload := strings.NewReader("{\n \"custom\": true,\n \"instrumental\": false,\n \"mv\": \"chirp-v6\",\n \"prompt\": \"<string>\",\n \"title\": \"<string>\",\n \"tags\": \"rock, blues, hip-hop, r&b\",\n \"negative_tags\": \"<string>\",\n \"style_weight\": 0.5,\n \"weirdness_constraint\": 0.5,\n \"audio_weight\": 0.5,\n \"auto_lyrics\": false,\n \"duration\": 120,\n \"persona_id\": \"<string>\",\n \"variety\": \"normal\",\n \"max_mode\": false,\n \"audio_format\": \"mp3\",\n \"hookUrl\": \"<string>\",\n \"isStorage\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ttapi.io/suno/v1/music")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom\": true,\n \"instrumental\": false,\n \"mv\": \"chirp-v6\",\n \"prompt\": \"<string>\",\n \"title\": \"<string>\",\n \"tags\": \"rock, blues, hip-hop, r&b\",\n \"negative_tags\": \"<string>\",\n \"style_weight\": 0.5,\n \"weirdness_constraint\": 0.5,\n \"audio_weight\": 0.5,\n \"auto_lyrics\": false,\n \"duration\": 120,\n \"persona_id\": \"<string>\",\n \"variety\": \"normal\",\n \"max_mode\": false,\n \"audio_format\": \"mp3\",\n \"hookUrl\": \"<string>\",\n \"isStorage\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/suno/v1/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom\": true,\n \"instrumental\": false,\n \"mv\": \"chirp-v6\",\n \"prompt\": \"<string>\",\n \"title\": \"<string>\",\n \"tags\": \"rock, blues, hip-hop, r&b\",\n \"negative_tags\": \"<string>\",\n \"style_weight\": 0.5,\n \"weirdness_constraint\": 0.5,\n \"audio_weight\": 0.5,\n \"auto_lyrics\": false,\n \"duration\": 120,\n \"persona_id\": \"<string>\",\n \"variety\": \"normal\",\n \"max_mode\": false,\n \"audio_format\": \"mp3\",\n \"hookUrl\": \"<string>\",\n \"isStorage\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"jobId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"status": "FAILED",
"message": "<string>",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Suno
Suno 音乐生成 API 文档
这是 Suno 的核心音乐生成接口,可根据文本提示生成带旋律、编曲和演唱风格的歌曲,适合快速产出可听成品。
POST
/
suno
/
v1
/
music
cURL
curl --request POST \
--url https://api.ttapi.io/suno/v1/music \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"custom": true,
"instrumental": false,
"mv": "chirp-v6",
"prompt": "<string>",
"title": "<string>",
"tags": "rock, blues, hip-hop, r&b",
"negative_tags": "<string>",
"style_weight": 0.5,
"weirdness_constraint": 0.5,
"audio_weight": 0.5,
"auto_lyrics": false,
"duration": 120,
"persona_id": "<string>",
"variety": "normal",
"max_mode": false,
"audio_format": "mp3",
"hookUrl": "<string>",
"isStorage": true
}
'import requests
url = "https://api.ttapi.io/suno/v1/music"
payload = {
"custom": True,
"instrumental": False,
"mv": "chirp-v6",
"prompt": "<string>",
"title": "<string>",
"tags": "rock, blues, hip-hop, r&b",
"negative_tags": "<string>",
"style_weight": 0.5,
"weirdness_constraint": 0.5,
"audio_weight": 0.5,
"auto_lyrics": False,
"duration": 120,
"persona_id": "<string>",
"variety": "normal",
"max_mode": False,
"audio_format": "mp3",
"hookUrl": "<string>",
"isStorage": True
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom: true,
instrumental: false,
mv: 'chirp-v6',
prompt: '<string>',
title: '<string>',
tags: 'rock, blues, hip-hop, r&b',
negative_tags: '<string>',
style_weight: 0.5,
weirdness_constraint: 0.5,
audio_weight: 0.5,
auto_lyrics: false,
duration: 120,
persona_id: '<string>',
variety: 'normal',
max_mode: false,
audio_format: 'mp3',
hookUrl: '<string>',
isStorage: true
})
};
fetch('https://api.ttapi.io/suno/v1/music', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ttapi.io/suno/v1/music",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'custom' => true,
'instrumental' => false,
'mv' => 'chirp-v6',
'prompt' => '<string>',
'title' => '<string>',
'tags' => 'rock, blues, hip-hop, r&b',
'negative_tags' => '<string>',
'style_weight' => 0.5,
'weirdness_constraint' => 0.5,
'audio_weight' => 0.5,
'auto_lyrics' => false,
'duration' => 120,
'persona_id' => '<string>',
'variety' => 'normal',
'max_mode' => false,
'audio_format' => 'mp3',
'hookUrl' => '<string>',
'isStorage' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ttapi.io/suno/v1/music"
payload := strings.NewReader("{\n \"custom\": true,\n \"instrumental\": false,\n \"mv\": \"chirp-v6\",\n \"prompt\": \"<string>\",\n \"title\": \"<string>\",\n \"tags\": \"rock, blues, hip-hop, r&b\",\n \"negative_tags\": \"<string>\",\n \"style_weight\": 0.5,\n \"weirdness_constraint\": 0.5,\n \"audio_weight\": 0.5,\n \"auto_lyrics\": false,\n \"duration\": 120,\n \"persona_id\": \"<string>\",\n \"variety\": \"normal\",\n \"max_mode\": false,\n \"audio_format\": \"mp3\",\n \"hookUrl\": \"<string>\",\n \"isStorage\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ttapi.io/suno/v1/music")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom\": true,\n \"instrumental\": false,\n \"mv\": \"chirp-v6\",\n \"prompt\": \"<string>\",\n \"title\": \"<string>\",\n \"tags\": \"rock, blues, hip-hop, r&b\",\n \"negative_tags\": \"<string>\",\n \"style_weight\": 0.5,\n \"weirdness_constraint\": 0.5,\n \"audio_weight\": 0.5,\n \"auto_lyrics\": false,\n \"duration\": 120,\n \"persona_id\": \"<string>\",\n \"variety\": \"normal\",\n \"max_mode\": false,\n \"audio_format\": \"mp3\",\n \"hookUrl\": \"<string>\",\n \"isStorage\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/suno/v1/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom\": true,\n \"instrumental\": false,\n \"mv\": \"chirp-v6\",\n \"prompt\": \"<string>\",\n \"title\": \"<string>\",\n \"tags\": \"rock, blues, hip-hop, r&b\",\n \"negative_tags\": \"<string>\",\n \"style_weight\": 0.5,\n \"weirdness_constraint\": 0.5,\n \"audio_weight\": 0.5,\n \"auto_lyrics\": false,\n \"duration\": 120,\n \"persona_id\": \"<string>\",\n \"variety\": \"normal\",\n \"max_mode\": false,\n \"audio_format\": \"mp3\",\n \"hookUrl\": \"<string>\",\n \"isStorage\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"jobId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"status": "FAILED",
"message": "<string>",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}这是 Suno API 的核心音乐生成接口。
如果你想查看完整的接口目录、推荐接入流程和相关能力,请先阅读 Suno API 总览。
Suno 旧模型已全部下架。当前仅支持
chirp-v6、chirp-v6-wild、chirp-v6-mini。若仍传入已下架的旧模型名称,将自动映射为 chirp-v6,完整对照见 模型映射。
创建自定义模型后,可将 mv 设为 chirp-custom:{model_id} 按该模型风格出歌。详见 创建自定义模型。persona_id 与 chirp-custom 不能同时使用。请求体
application/json
- 自定义模式
- 灵感模式
自定义模式,固定为 true。
可用选项:
true 是否生成纯音乐。
- true:生成纯音乐,忽略歌词
- false:生成含歌词音轨。此时 prompt 必填
歌词。当 instrumental 为 false 时必填。将作为歌词使用并在生成的音轨中演唱,最多 5000 字符。
音乐标题,最多 80 字符。
音乐风格,最多 1000 字符。
示例:
"rock, blues, hip-hop, r&b"
不想要生成的音乐风格。
音乐风格权重,范围 0.00-1.00。
示例:
0.5
音频奇妙度权重,范围 0.00-1.00。
示例:
0.5
音频权重,范围 0.00-1.00。
示例:
0.5
是否自动生成歌词。
- true:根据输入的歌词进行二次创作
- false:使用输入的歌词生成音乐
音频时长,单位:秒。赋值范围: 10 <= x <= 360。
示例:
120
音色性别
-
Male:男性
-
Female:女性
可用选项:
Male, Female 音乐风格 id。
不能与 mv=chirp-custom:{model_id} 同时使用。
风格多样性。控制生成结果相对指定风格的变化程度。
- off:Exact style(精确风格)
- normal:Balanced variety(均衡变化)
- high:Distinct styles(风格差异明显)
- extra:Bold exploration(大胆探索)
- max:Unreasonably varied(极度发散)
可用选项:
off, normal, high, extra, max 是否使用更多计算资源,以在整首歌中最大化一致性。
- false:否(默认)
- true:是。开启后额度消耗翻倍
任务最终成功后 audioUrl 的音频格式。
可用选项:
mp3, m4a, wav 示例:
"mp3"
回调通知地址
是否转存
- true:音频将进行转存,返回TTAPI CDN地址
- false:返回官方源地址
最后修改于 2026年9月9日