cURL
curl --request POST \
--url https://api.ttapi.io/producer/v1/music \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"sound_prompt": "<string>",
"lyrics_text": "<string>",
"instrumental": "false",
"mv": "FUZZ-2.0",
"title": "<string>",
"cover_art_url": "<string>",
"seed": "<string>",
"lyrics_strength": "0.5",
"sound_strength": "0.5",
"weirdness": "0.5",
"is_storage": "false",
"hook_url": "<string>"
}
'import requests
url = "https://api.ttapi.io/producer/v1/music"
payload = {
"sound_prompt": "<string>",
"lyrics_text": "<string>",
"instrumental": "false",
"mv": "FUZZ-2.0",
"title": "<string>",
"cover_art_url": "<string>",
"seed": "<string>",
"lyrics_strength": "0.5",
"sound_strength": "0.5",
"weirdness": "0.5",
"is_storage": "false",
"hook_url": "<string>"
}
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({
sound_prompt: '<string>',
lyrics_text: '<string>',
instrumental: 'false',
mv: 'FUZZ-2.0',
title: '<string>',
cover_art_url: '<string>',
seed: '<string>',
lyrics_strength: '0.5',
sound_strength: '0.5',
weirdness: '0.5',
is_storage: 'false',
hook_url: '<string>'
})
};
fetch('https://api.ttapi.io/producer/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/producer/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([
'sound_prompt' => '<string>',
'lyrics_text' => '<string>',
'instrumental' => 'false',
'mv' => 'FUZZ-2.0',
'title' => '<string>',
'cover_art_url' => '<string>',
'seed' => '<string>',
'lyrics_strength' => '0.5',
'sound_strength' => '0.5',
'weirdness' => '0.5',
'is_storage' => 'false',
'hook_url' => '<string>'
]),
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/producer/v1/music"
payload := strings.NewReader("{\n \"sound_prompt\": \"<string>\",\n \"lyrics_text\": \"<string>\",\n \"instrumental\": \"false\",\n \"mv\": \"FUZZ-2.0\",\n \"title\": \"<string>\",\n \"cover_art_url\": \"<string>\",\n \"seed\": \"<string>\",\n \"lyrics_strength\": \"0.5\",\n \"sound_strength\": \"0.5\",\n \"weirdness\": \"0.5\",\n \"is_storage\": \"false\",\n \"hook_url\": \"<string>\"\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/producer/v1/music")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sound_prompt\": \"<string>\",\n \"lyrics_text\": \"<string>\",\n \"instrumental\": \"false\",\n \"mv\": \"FUZZ-2.0\",\n \"title\": \"<string>\",\n \"cover_art_url\": \"<string>\",\n \"seed\": \"<string>\",\n \"lyrics_strength\": \"0.5\",\n \"sound_strength\": \"0.5\",\n \"weirdness\": \"0.5\",\n \"is_storage\": \"false\",\n \"hook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/producer/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 \"sound_prompt\": \"<string>\",\n \"lyrics_text\": \"<string>\",\n \"instrumental\": \"false\",\n \"mv\": \"FUZZ-2.0\",\n \"title\": \"<string>\",\n \"cover_art_url\": \"<string>\",\n \"seed\": \"<string>\",\n \"lyrics_strength\": \"0.5\",\n \"sound_strength\": \"0.5\",\n \"weirdness\": \"0.5\",\n \"is_storage\": \"false\",\n \"hook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"jobId": "jobId"
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Producer
生成音乐
deprecated
通过文字提示词或者自定义歌词生成音乐,注:每次请求生成一首音乐
POST
/
producer
/
v1
/
music
cURL
curl --request POST \
--url https://api.ttapi.io/producer/v1/music \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"sound_prompt": "<string>",
"lyrics_text": "<string>",
"instrumental": "false",
"mv": "FUZZ-2.0",
"title": "<string>",
"cover_art_url": "<string>",
"seed": "<string>",
"lyrics_strength": "0.5",
"sound_strength": "0.5",
"weirdness": "0.5",
"is_storage": "false",
"hook_url": "<string>"
}
'import requests
url = "https://api.ttapi.io/producer/v1/music"
payload = {
"sound_prompt": "<string>",
"lyrics_text": "<string>",
"instrumental": "false",
"mv": "FUZZ-2.0",
"title": "<string>",
"cover_art_url": "<string>",
"seed": "<string>",
"lyrics_strength": "0.5",
"sound_strength": "0.5",
"weirdness": "0.5",
"is_storage": "false",
"hook_url": "<string>"
}
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({
sound_prompt: '<string>',
lyrics_text: '<string>',
instrumental: 'false',
mv: 'FUZZ-2.0',
title: '<string>',
cover_art_url: '<string>',
seed: '<string>',
lyrics_strength: '0.5',
sound_strength: '0.5',
weirdness: '0.5',
is_storage: 'false',
hook_url: '<string>'
})
};
fetch('https://api.ttapi.io/producer/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/producer/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([
'sound_prompt' => '<string>',
'lyrics_text' => '<string>',
'instrumental' => 'false',
'mv' => 'FUZZ-2.0',
'title' => '<string>',
'cover_art_url' => '<string>',
'seed' => '<string>',
'lyrics_strength' => '0.5',
'sound_strength' => '0.5',
'weirdness' => '0.5',
'is_storage' => 'false',
'hook_url' => '<string>'
]),
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/producer/v1/music"
payload := strings.NewReader("{\n \"sound_prompt\": \"<string>\",\n \"lyrics_text\": \"<string>\",\n \"instrumental\": \"false\",\n \"mv\": \"FUZZ-2.0\",\n \"title\": \"<string>\",\n \"cover_art_url\": \"<string>\",\n \"seed\": \"<string>\",\n \"lyrics_strength\": \"0.5\",\n \"sound_strength\": \"0.5\",\n \"weirdness\": \"0.5\",\n \"is_storage\": \"false\",\n \"hook_url\": \"<string>\"\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/producer/v1/music")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sound_prompt\": \"<string>\",\n \"lyrics_text\": \"<string>\",\n \"instrumental\": \"false\",\n \"mv\": \"FUZZ-2.0\",\n \"title\": \"<string>\",\n \"cover_art_url\": \"<string>\",\n \"seed\": \"<string>\",\n \"lyrics_strength\": \"0.5\",\n \"sound_strength\": \"0.5\",\n \"weirdness\": \"0.5\",\n \"is_storage\": \"false\",\n \"hook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/producer/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 \"sound_prompt\": \"<string>\",\n \"lyrics_text\": \"<string>\",\n \"instrumental\": \"false\",\n \"mv\": \"FUZZ-2.0\",\n \"title\": \"<string>\",\n \"cover_art_url\": \"<string>\",\n \"seed\": \"<string>\",\n \"lyrics_strength\": \"0.5\",\n \"sound_strength\": \"0.5\",\n \"weirdness\": \"0.5\",\n \"is_storage\": \"false\",\n \"hook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"jobId": "jobId"
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}这是 Producer API 的核心音乐生成接口。
如果你想查看完整的接口目录、推荐接入流程和相关能力,请先阅读 Producer API 总览。
请求体
application/json
音频提示词,sound_prompt与lyrics_text不可同时为空
歌词文本,sound_prompt与lyrics_text不可同时为空
是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词
使用模型,支持范围
可用选项:
FUZZ-2.0 Pro, FUZZ-2.0, FUZZ-2.0 Raw, FUZZ-1.1 Pro, FUZZ-1.0 Pro, FUZZ-1.0, FUZZ-1.1, FUZZ-0.8, Lyria 3 preview, Lyria 3 Pro 标题
封面url
随机种子
歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间
音频提示词强度,可选0.2-1之间
风格奇特度,可选 0-1之间
是否转存 true-转存 false-不转存
回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致
最后修改于 2026年4月26日
⌘I