🎹Producer API

Producer AI‌(前身为 ‌Riffusion‌)是一款基于人工智能的音乐与音频生成工具,专注于将文本描述转化为独特的音乐片段或音效的AI产品,现你可以在TTAPI中以简单的方式使用它。

生成音乐

POST https://api.ttapi.io/producer/v1/music

通过文字提示词或者自定义歌词生成音乐,注:每次请求生成一首音乐,

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

sound_prompt

string

音频提示词,sound_prompt与lyrics_text不可同时为空

lyrics_text

string

歌词文本,sound_prompt与lyrics_text不可同时为空

instrumental

boolean

是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词 默认为 false

mv

string

使用模型,支持范围: FUZZ-2.0 FUZZ-2.0 Raw FUZZ-1.1 Pro FUZZ-1.0 Pro FUZZ-1.0 FUZZ-1.1 FUZZ-0.8 默认:FUZZ-2.0

title

string

标题

cover_art_url

string

封面 url

seed

string

随机种子

lyrics_strength

number

歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间,默认0.5

sound_strength

number

音频提示词强度,可选0.2-1之间,默认0.5

weirdness

number

风格奇特度,可选 0-1之间,默认0.5

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

如果 hookUrl 不为空,任务成功或者失败后系统会向您设置的 hookUrl 发送一个 json响应

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "d8b553d0-cb53-442d-aae8-bba319ab5d65"
    }
}

生成歌词

POST https://api.ttapi.io/producer/v1/lyrics

根据提示词生成歌词

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

prompt

string

提示词

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "ffd6870b-9a83-47e6-9d57-601efced86b5",
        "title": "Work It Out",
        "lyrics": "[Verse 1]\nBeat beats beneath my breath\nSweat starts to show itself\nCan't catch a quiet breath\nFeel the fire fight itself\n\n[Pre-Chorus]\nWork won't wait, won't waste away\nPush the pace, I play today\n\n[Chorus]\nMove my muscles, make it better\nFeel the freedom in my fever\nDance the duty, dance forever\nBeat the burden, be believer\nWork it out, work it out\nMove it now, move it now\n\n[Verse 2 - Barely introducing the topic]\nSomething's spinning in my soul\nPressure pressing, taking toll\nNeed to find another role\nBreak the weight and make me whole\n\n[Pre-Chorus]\nWork won't wait, won't waste away\nPush the pace, I play today\n\n[Chorus]\nMove my muscles, make it better\nFeel the freedom in my fever\nDance the duty, dance forever\nBeat the burden, be believer\nWork it out, work it out\nMove it now, move it now\n\n[Rap]\nStress is stacking, spine is aching, spirit's shaking daily\nBut I battle with my body when the bass begins to play me\nFeel the friction fade away when feet begin to fly free\nMusic makes the madness melt, my mind begins to find me\nLabor's loading on my lungs but love is lifting lightly\nBeat becomes my breathing, brings me back to being brightly\nSweat becomes my symphony, sync becomes my saving\nDancing through the difficulty, doubt becomes my craving\nMove until the morning makes me feel like I am flying\nWork without the worry, without walls that keep me crying\nFreedom in the frequency, feeling what I'm fighting\nBody beats the burden when the bass begins its biting\n\n[Bridge]\nStop the struggle, start to shake\nFeel the weight begin to break\nMotion makes the moment take\nAll the ache away\n\n[Final Chorus]\nMove my muscles, make it better\nFeel the freedom in my fever\nDance the duty, dance forever\nBeat the burden, be believer\nWork it out, work it out\nMove it now, move it now\nWork it out, work it out\nMove it now, move it now\n\n[Outro]\nBeat beats beneath my breath\nDance the weight right off my chest"
    }
}

音乐延伸

POST https://api.ttapi.io/producer/v1/extend

对生成的音频进行延伸扩展,注意:需要上一条任务成功完成后方可使用此接口进行延伸扩展

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

starts

number

表示从原始音频的第 n 秒进行延伸扩展,单位秒。 默认:30.00

sound_prompt

string

音频提示词,sound_prompt与lyrics_text不可同时为空

lyrics_text

string

歌词文本,sound_prompt与lyrics_text不可同时为空

instrumental

boolean

是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词 默认为 false

mv

string

使用模型,支持范围: FUZZ-2.0 FUZZ-2.0 Raw FUZZ-1.1 Pro FUZZ-1.0 Pro FUZZ-1.0 FUZZ-1.1 FUZZ-0.8 默认:FUZZ-2.0

title

string

标题

seed

string

随机种子

lyrics_strength

number

歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间,默认0.5

sound_strength

number

音频提示词强度,可选0.2-1之间,默认0.5

weirdness

number

风格奇特度,可选 0-1之间,默认0.5

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "943583cb-08f4-4077-ad1e-f1bfc6c1191a"
    }
}

音乐翻版

POST https://api.ttapi.io/producer/v1/cover

对生成的音频进行翻版

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

sound_prompt

string

音频提示词,sound_prompt与lyrics_text不可同时为空

lyrics_text

string

歌词文本,sound_prompt与lyrics_text不可同时为空

instrumental

boolean

是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词 默认为 false

mv

string

使用模型,支持范围: FUZZ-2.0 FUZZ-2.0 Raw FUZZ-1.1 Pro FUZZ-1.0 Pro FUZZ-1.0 FUZZ-1.1 FUZZ-0.8 默认:FUZZ-2.0

title

string

标题

seed

string

随机种子

lyrics_strength

number

歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间,默认0.5

sound_strength

number

音频提示词强度,可选0.2-1之间,默认0.5

weirdness

number

风格奇特度,可选 0-1之间,默认0.5

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "943583cb-08f4-4077-ad1e-f1bfc6c1191a"
    }
}

音乐变换

POST https://api.ttapi.io/producer/v1/variation

根据上一首音乐的seed值生成一首类似效果的新音乐

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "943583cb-08f4-4077-ad1e-f1bfc6c1191a"
    }
}

音乐片段替换

POST https://api.ttapi.io/producer/v1/replace

对生成的音频的部分片段进行替换

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

sound_prompt

string

音频提示词,sound_prompt与lyrics_text不可同时为空

lyrics_text

string

歌词文本,sound_prompt与lyrics_text不可同时为空

instrumental

boolean

是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词 默认为 false

starts

number

表示从原始音频的 x 秒处开始进行替换,单位(秒)

例如:30.01

ends

number

替换片段的结束时间(秒),为空表示替换将持续到音频的末尾

mv

string

使用模型,支持范围: FUZZ-2.0 FUZZ-2.0 Raw FUZZ-1.1 Pro FUZZ-1.0 Pro FUZZ-1.0 FUZZ-1.1 FUZZ-0.8 默认:FUZZ-2.0

title

string

标题

seed

string

随机种子

lyrics_strength

number

歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间,默认0.5

sound_strength

number

音频提示词强度,可选0.2-1之间,默认0.5

weirdness

number

风格奇特度,可选 0-1之间,默认0.5

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "943583cb-08f4-4077-ad1e-f1bfc6c1191a"
    }
}

人声翻版

POST https://api.ttapi.io/producer/v1/vocals-swap

对生成的音频进行人声翻版

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

sound_prompt

string

音频提示词,sound_prompt与lyrics_text不可同时为空

lyrics_text

string

歌词文本,sound_prompt与lyrics_text不可同时为空

instrumental

boolean

是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词 默认为 false

mv

string

使用模型,支持范围: FUZZ-2.0 FUZZ-2.0 Raw FUZZ-1.1 Pro FUZZ-1.0 Pro FUZZ-1.0 FUZZ-1.1 FUZZ-0.8 默认:FUZZ-2.0

title

string

标题

seed

string

随机种子

lyrics_strength

number

歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间,默认0.7

sound_strength

number

音频提示词强度,可选0.2-1之间,默认0.7

cover_strength

number

翻唱强度 0.2-1之间,默认1

weirdness

number

风格奇特度,可选 0-1之间,默认0.5

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "943583cb-08f4-4077-ad1e-f1bfc6c1191a"
    }
}

伴奏翻版

POST https://api.ttapi.io/producer/v1/instrumentals-swap

对生成的音频进行伴奏翻版

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

sound_prompt

string

音频提示词,sound_prompt与lyrics_text不可同时为空

lyrics_text

string

歌词文本,sound_prompt与lyrics_text不可同时为空

instrumental

boolean

是否生成纯音乐,true 为生成纯音乐,true的情况下会忽略自定义歌词 默认为 false

mv

string

使用模型,支持范围: FUZZ-2.0 FUZZ-2.0 Raw FUZZ-1.1 Pro FUZZ-1.0 Pro FUZZ-1.0 FUZZ-1.1 FUZZ-0.8 默认:FUZZ-2.0

title

string

标题

seed

string

随机种子

lyrics_strength

number

歌词强度,表示歌词在音频生成中的影响程度,可选0-1之间,默认0.7

sound_strength

number

音频提示词强度,可选0.2-1之间,默认0.7

cover_strength

number

翻唱强度 0.2-1之间,默认1

weirdness

number

风格奇特度,可选 0-1之间,默认0.5

is_storage

boolean

是否转存 true-转存 false-不转存 默认:false

hook_url

string

回调通知地址,当设置此参数,任务成功或者失败降会向该地址发送一个post请求,携带数据与查询任务结果中返回一致

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "943583cb-08f4-4077-ad1e-f1bfc6c1191a"
    }
}

生成视频 【免费接口】

POST https://api.ttapi.io/producer/v1/generate-video

生成音频的视频

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

music_id

string

父任务的musicId

preset

boolean

预设三种生成视频类型:modern player simple 默认 simple

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "videoUrl": "https://storage.googleapis.com/corpusant-app-public/song-videos/77ce096c-22c2-442b-a868-4100867a45df:0835e01ecc5ae00a000cc5a9b8f3035dea48508645a6142cbd1d7e5b72e0d4d7.mp4",
        "status": "complete"
    }
}

获取任务状态 - fetch

GET https://api.ttapi.io/producer/v1/fetch

查询任务结果,该接口不消耗quota,免费使用

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Query参数

参数
类型
是否必须
描述

jobId

string

生成接口同步返回的jobId

响应示例

返回结果与异步回调数据结构一致

异步回调 JSON 结构

{
    "status": "SUCCESS",
    "message": "success",
    "jobId": "ffd6870b-9a83-47e6-9d57-601efced86b5",
    "data": {
        "jobId": "ffd6870b-9a83-47e6-9d57-601efced86b5",
        "action": "lyrics",
        "progress": "100%",
        "mv": "FUZZ-2.0",
        "quota": "1",
        "hookUrl": null,
        "musics": [
            {
                "musicId": "07d737cf-9509-4132-99f5-a17339bd7462",
                "title": "Work It Out",
                "lyrics": "[Verse 1]\nBeat beats beneath my breath\nSweat starts to show itself\nCan't catch a quiet breath\nFeel the fire fight itself\n\n[Pre-Chorus]\nWork won't wait, won't waste away\nPush the pace, I play today\n\n[Chorus]\nMove my muscles, make it better\nFeel the freedom in my fever\nDance the duty, dance forever\nBeat the burden, be believer\nWork it out, work it out\nMove it now, move it now\n\n[Verse 2 - Barely introducing the topic]\nSomething's spinning in my soul\nPressure pressing, taking toll\nNeed to find another role\nBreak the weight and make me whole\n\n[Pre-Chorus]\nWork won't wait, won't waste away\nPush the pace, I play today\n\n[Chorus]\nMove my muscles, make it better\nFeel the freedom in my fever\nDance the duty, dance forever\nBeat the burden, be believer\nWork it out, work it out\nMove it now, move it now\n\n[Rap]\nStress is stacking, spine is aching, spirit's shaking daily\nBut I battle with my body when the bass begins to play me\nFeel the friction fade away when feet begin to fly free\nMusic makes the madness melt, my mind begins to find me\nLabor's loading on my lungs but love is lifting lightly\nBeat becomes my breathing, brings me back to being brightly\nSweat becomes my symphony, sync becomes my saving\nDancing through the difficulty, doubt becomes my craving\nMove until the morning makes me feel like I am flying\nWork without the worry, without walls that keep me crying\nFreedom in the frequency, feeling what I'm fighting\nBody beats the burden when the bass begins its biting\n\n[Bridge]\nStop the struggle, start to shake\nFeel the weight begin to break\nMotion makes the moment take\nAll the ache away\n\n[Final Chorus]\nMove my muscles, make it better\nFeel the freedom in my fever\nDance the duty, dance forever\nBeat the burden, be believer\nWork it out, work it out\nMove it now, move it now\nWork it out, work it out\nMove it now, move it now\n\n[Outro]\nBeat beats beneath my breath\nDance the weight right off my chest",
                "imageUrl": null,
                "audioUrl": null,
                "videoUrl": null,
                "imageId": null,
                "topic": null,
                "sound": null,
                "seed": null,
                "durations": null,
                "createdAt": null
            }
        ]
    }
}

返回JSON结构详解

name
value

status

ON_QUEUE //执行中

SUCCESS //成功 FAILED //失败

quota

实际消耗额度

Last updated

Was this helpful?