# Producer API

{% hint style="danger" %}
此文档已停止维护，最新文档地址：<https://docs.ttapi.io>
{% endhint %}

## 生成音乐

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/music`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>sound_prompt</td><td>string</td><td>是</td><td>音频提示词，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>lyrics_text</td><td>string</td><td>是</td><td>歌词文本，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>instrumental</td><td>boolean</td><td>否</td><td>是否生成纯音乐，<code>true</code> 为生成纯音乐，true的情况下会忽略自定义歌词<br>默认为 <code>false</code></td></tr><tr><td>mv</td><td>string</td><td>否</td><td><p>使用模型，支持范围：</p><p><code>FUZZ-2.0 Pro</code><br><code>FUZZ-2.0</code>  <code>FUZZ-2.0 Raw</code>  <code>FUZZ-1.1 Pro</code> <br><code>FUZZ-1.0 Pro</code>   <code>FUZZ-1.0</code>  <code>FUZZ-1.1</code>   <code>FUZZ-0.8</code>  <code>Lyria 3 preview</code><br>默认：<code>FUZZ-2.0</code></p></td></tr><tr><td>title</td><td>string</td><td>否</td><td>标题</td></tr><tr><td>cover_art_url</td><td>string</td><td>否</td><td>封面 url</td></tr><tr><td>seed</td><td>string</td><td>否</td><td>随机种子</td></tr><tr><td>lyrics_strength</td><td>number</td><td>否</td><td>歌词强度，表示歌词在音频生成中的影响程度，可选0-1之间，默认0.5</td></tr><tr><td>sound_strength</td><td>number</td><td>否</td><td>音频提示词强度，可选0.2-1之间，默认0.5</td></tr><tr><td>weirdness</td><td>number</td><td>否</td><td>风格奇特度，可选 0-1之间，默认0.5</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

{% hint style="info" %}
如果 hookUrl 不为空，任务成功或者失败后系统会向您设置的 hookUrl 发送一个 [json响应](#yi-bu-hui-tiao-json-jie-gou)。
{% endhint %}

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}

{% tab title="400" %}

```
{
  "status": "FAILED",
  "message": "",
  "data": null
}
```

{% endtab %}
{% endtabs %}

## 生成歌词

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/lyrics`

> 根据提示词生成歌词

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>prompt</td><td>string</td><td>是</td><td>提示词</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

```
{
    "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"
    }
}
```

{% endtab %}
{% endtabs %}

## 音乐延伸

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/extend`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>starts</td><td>number</td><td>是</td><td>表示从原始音频的第 n 秒进行延伸扩展，单位秒。<br>默认：30.00</td></tr><tr><td>sound_prompt</td><td>string</td><td>是</td><td>音频提示词，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>lyrics_text</td><td>string</td><td>是</td><td>歌词文本，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>instrumental</td><td>boolean</td><td>否</td><td>是否生成纯音乐，<code>true</code> 为生成纯音乐，true的情况下会忽略自定义歌词<br>默认为 <code>false</code></td></tr><tr><td>mv</td><td>string</td><td>否</td><td>使用模型，支持范围：<br><code>FUZZ-2.0 Pro</code><br><code>FUZZ-2.0</code>  <code>FUZZ-2.0 Raw</code>  <code>FUZZ-1.1 Pro</code> <br><code>FUZZ-1.0 Pro</code>   <code>FUZZ-1.0</code>  <code>FUZZ-1.1</code>   <code>FUZZ-0.8</code><br>默认：<code>FUZZ-2.0</code></td></tr><tr><td>title</td><td>string</td><td>否</td><td>标题</td></tr><tr><td>cover_art_url</td><td>string</td><td>否</td><td>封面 url</td></tr><tr><td>seed</td><td>string</td><td>否</td><td>随机种子</td></tr><tr><td>lyrics_strength</td><td>number</td><td>否</td><td>歌词强度，表示歌词在音频生成中的影响程度，可选0-1之间，默认0.5</td></tr><tr><td>sound_strength</td><td>number</td><td>否</td><td>音频提示词强度，可选0.2-1之间，默认0.5</td></tr><tr><td>weirdness</td><td>number</td><td>否</td><td>风格奇特度，可选 0-1之间，默认0.5</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}
{% endtabs %}

## 音乐翻版

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/cover`

> 对生成的音频进行翻版

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>sound_prompt</td><td>string</td><td>是</td><td>音频提示词，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>lyrics_text</td><td>string</td><td>是</td><td>歌词文本，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>instrumental</td><td>boolean</td><td>否</td><td>是否生成纯音乐，<code>true</code> 为生成纯音乐，true的情况下会忽略自定义歌词<br>默认为 <code>false</code></td></tr><tr><td>mv</td><td>string</td><td>否</td><td>使用模型，支持范围：<br><code>FUZZ-2.0 Pro</code><br><code>FUZZ-2.0</code>  <code>FUZZ-2.0 Raw</code>  <code>FUZZ-1.1 Pro</code> <br><code>FUZZ-1.0 Pro</code>   <code>FUZZ-1.0</code>  <code>FUZZ-1.1</code>   <code>FUZZ-0.8</code><br>默认：<code>FUZZ-2.0</code></td></tr><tr><td>title</td><td>string</td><td>否</td><td>标题</td></tr><tr><td>cover_art_url</td><td>string</td><td>否</td><td>封面 url</td></tr><tr><td>seed</td><td>string</td><td>否</td><td>随机种子</td></tr><tr><td>lyrics_strength</td><td>number</td><td>否</td><td>歌词强度，表示歌词在音频生成中的影响程度，可选0-1之间，默认0.5</td></tr><tr><td>sound_strength</td><td>number</td><td>否</td><td>音频提示词强度，可选0.2-1之间，默认0.5</td></tr><tr><td>weirdness</td><td>number</td><td>否</td><td>风格奇特度，可选 0-1之间，默认0.5</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}
{% endtabs %}

## 音乐变换

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/variation`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}
{% endtabs %}

## 音乐片段替换

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/replace`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>sound_prompt</td><td>string</td><td>是</td><td>音频提示词，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>lyrics_text</td><td>string</td><td>是</td><td>歌词文本，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>instrumental</td><td>boolean</td><td>否</td><td>是否生成纯音乐，<code>true</code> 为生成纯音乐，true的情况下会忽略自定义歌词<br>默认为 <code>false</code></td></tr><tr><td>starts</td><td>number</td><td>否</td><td><p>表示从原始音频的 x 秒处开始进行替换，单位（秒）</p><p>例如：30.01</p></td></tr><tr><td>ends</td><td>number</td><td>否</td><td>替换片段的结束时间（秒），为空表示替换将持续到音频的末尾</td></tr><tr><td>mv</td><td>string</td><td>否</td><td>使用模型，支持范围：<br><code>FUZZ-2.0 Pro</code><br><code>FUZZ-2.0</code>  <code>FUZZ-2.0 Raw</code>  <code>FUZZ-1.1 Pro</code> <br><code>FUZZ-1.0 Pro</code>   <code>FUZZ-1.0</code>  <code>FUZZ-1.1</code>   <code>FUZZ-0.8</code><br>默认：<code>FUZZ-2.0</code></td></tr><tr><td>title</td><td>string</td><td>否</td><td>标题</td></tr><tr><td>cover_art_url</td><td>string</td><td>否</td><td>封面 url</td></tr><tr><td>seed</td><td>string</td><td>否</td><td>随机种子</td></tr><tr><td>lyrics_strength</td><td>number</td><td>否</td><td>歌词强度，表示歌词在音频生成中的影响程度，可选0-1之间，默认0.5</td></tr><tr><td>sound_strength</td><td>number</td><td>否</td><td>音频提示词强度，可选0.2-1之间，默认0.5</td></tr><tr><td>weirdness</td><td>number</td><td>否</td><td>风格奇特度，可选 0-1之间，默认0.5</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

```

{% endtab %}
{% endtabs %}

## 人声翻版

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/vocals-swap`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>sound_prompt</td><td>string</td><td>是</td><td>音频提示词，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>lyrics_text</td><td>string</td><td>是</td><td>歌词文本，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>instrumental</td><td>boolean</td><td>否</td><td>是否生成纯音乐，<code>true</code> 为生成纯音乐，true的情况下会忽略自定义歌词<br>默认为 <code>false</code></td></tr><tr><td>mv</td><td>string</td><td>否</td><td>使用模型，支持范围：<br><code>FUZZ-2.0 Pro</code><br><code>FUZZ-2.0</code>  <code>FUZZ-2.0 Raw</code>  <code>FUZZ-1.1 Pro</code> <br><code>FUZZ-1.0 Pro</code>   <code>FUZZ-1.0</code>  <code>FUZZ-1.1</code>   <code>FUZZ-0.8</code><br>默认：<code>FUZZ-2.0</code></td></tr><tr><td>title</td><td>string</td><td>否</td><td>标题</td></tr><tr><td>cover_art_url</td><td>string</td><td>否</td><td>封面url</td></tr><tr><td>seed</td><td>string</td><td>否</td><td>随机种子</td></tr><tr><td>lyrics_strength</td><td>number</td><td>否</td><td>歌词强度，表示歌词在音频生成中的影响程度，可选0-1之间，默认0.7</td></tr><tr><td>sound_strength</td><td>number</td><td>否</td><td>音频提示词强度，可选0.2-1之间，默认0.7</td></tr><tr><td>cover_strength</td><td>number</td><td>否</td><td>翻唱强度 0.2-1之间，默认1</td></tr><tr><td>weirdness</td><td>number</td><td>否</td><td>风格奇特度，可选 0-1之间，默认0.5</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

```

{% endtab %}
{% endtabs %}

## 伴奏翻版

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/instrumentals-swap`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>sound_prompt</td><td>string</td><td>是</td><td>音频提示词，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>lyrics_text</td><td>string</td><td>是</td><td>歌词文本，sound_prompt与lyrics_text不可同时为空</td></tr><tr><td>instrumental</td><td>boolean</td><td>否</td><td>是否生成纯音乐，<code>true</code> 为生成纯音乐，true的情况下会忽略自定义歌词<br>默认为 <code>false</code></td></tr><tr><td>mv</td><td>string</td><td>否</td><td>使用模型，支持范围：<br><code>FUZZ-2.0 Pro</code><br><code>FUZZ-2.0</code>  <code>FUZZ-2.0 Raw</code>  <code>FUZZ-1.1 Pro</code> <br><code>FUZZ-1.0 Pro</code>   <code>FUZZ-1.0</code>  <code>FUZZ-1.1</code>   <code>FUZZ-0.8</code><br>默认：<code>FUZZ-2.0</code></td></tr><tr><td>title</td><td>string</td><td>否</td><td>标题</td></tr><tr><td>cover_art_url</td><td>string</td><td>否</td><td>封面url</td></tr><tr><td>seed</td><td>string</td><td>否</td><td>随机种子</td></tr><tr><td>lyrics_strength</td><td>number</td><td>否</td><td>歌词强度，表示歌词在音频生成中的影响程度，可选0-1之间，默认0.7</td></tr><tr><td>sound_strength</td><td>number</td><td>否</td><td>音频提示词强度，可选0.2-1之间，默认0.7</td></tr><tr><td>cover_strength</td><td>number</td><td>否</td><td>翻唱强度 0.2-1之间，默认1</td></tr><tr><td>weirdness</td><td>number</td><td>否</td><td>风格奇特度，可选 0-1之间，默认0.5</td></tr><tr><td>is_storage</td><td>boolean</td><td>否</td><td>是否转存  <code>true</code>-转存 <code>false</code>-不转存 <br>默认：<code>false</code></td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

```

{% endtab %}
{% endtabs %}

## 词曲分离

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/stems`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}
{% endtabs %}

## 下载音频

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/download`

> 下载各种格式的音频

**Headers**

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>format</td><td>string</td><td>是</td><td>可选范围 <code>wav</code>, <code>mp3</code></td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

```
{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "jobId": "c8bb8b69-25ed-49f9-bdf8-3e1e669e78f2"
    }
}
```

{% endtab %}
{% endtabs %}

## 上传音频 【免费接口】

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/upload`

> 上传自己的音频，并对上传的音频进行后续处理

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>audio_url</td><td>string</td><td>是</td><td>音频文件地址</td></tr><tr><td>hook_url</td><td>string</td><td>否</td><td>回调通知地址，当设置此参数，任务成功或者失败降会向该地址发送一个post请求，携带数据与查询任务结果中返回一致</td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}
{% endtabs %}

## 生成视频 【免费接口】

<mark style="color:green;">`POST`</mark>  `https://api.ttapi.io/producer/v1/generate-video`

> 生成音频的视频

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Body**

<table><thead><tr><th width="182">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td>music_id</td><td>string</td><td>是</td><td>父任务的musicId</td></tr><tr><td>preset</td><td>string</td><td>否</td><td>预设三种生成视频类型：<code>modern</code>  <code>player</code>  <code>simple</code>  默认 <code>simple</code></td></tr></tbody></table>

#### 响应示例

{% tabs %}
{% tab title="200" %}

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

{% endtab %}
{% endtabs %}

## 获取任务状态 - fetch

<mark style="color:red;">`GET`</mark> `https://api.ttapi.io/producer/v1/fetch`

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

**Headers**

| Name         | Value                |
| ------------ | -------------------- |
| TT-API-KEY   | 用于请求授权 TT-API 的API密钥 |
| Content-Type | application-json     |

**Query参数**

<table><thead><tr><th width="155">参数</th><th width="122">类型</th><th width="101">是否必须</th><th>描述</th></tr></thead><tbody><tr><td><code>jobId</code></td><td>string</td><td>是</td><td>生成接口同步返回的jobId</td></tr></tbody></table>

#### 响应示例

**返回结果与**[**异步回调**](#yi-bu-hui-tiao-json-jie-gou)**数据结构一致**

## 异步回调 JSON 结构

{% tabs %}
{% tab title="SUCCESS" %}

```
{
    "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
            }
        ]
    }
}
```

{% endtab %}

{% tab title="ON\_QUEUE" %}

```
{
    "status": "ON_QUEUE",
    "message": null,
    "jobId": "cbe4c0e3-80b9-4c84-adde-20f98f933a1c",
    "data": {
        "jobId": "cbe4c0e3-80b9-4c84-adde-20f98f933a1c",
        "action": "music",
        "progress": null,
        "mv": "FUZZ-2.0",
        "quota": "5",
        "hookUrl": "https://webhook-test.com/0e55ca218c11459ac69b6bedf05191dd",
        "musics": [
            {
                "musicId": "1926df39-ecd6-4ae9-893e-b489688cae0d",
                "title": null,
                "lyrics": null,
                "imageUrl": null,
                "audioUrl": null,
                "videoUrl": null,
                "imageId": null,
                "topic": null,
                "sound": null,
                "seed": null,
                "durations": null,
                "createdAt": null
            }
        ]
    }
}
```

{% endtab %}

{% tab title="FAILED" %}

```
{
    "status": "FAILED",
    "message": "job timeout",
    "jobId": "ac729f2c-aff4-45a9-85f6-024a078e21f1",
    "data": {
        "jobId": "ac729f2c-aff4-45a9-85f6-024a078e21f1",
        "action": "music",
        "progress": null,
        "mv": "FUZZ-2.0",
        "quota": "0",
        "hookUrl": "https://webhook-test.com/0e55ca218c11459ac69b6bedf05191dd",
        "musics": null
    }
}
```

{% endtab %}
{% endtabs %}

## 返回JSON结构详解

| name   | value                                                        |
| ------ | ------------------------------------------------------------ |
| status | <p>ON\_QUEUE  //执行中</p><p>SUCCESS   //成功<br>FAILED  //失败</p> |
| quota  | 实际消耗额度                                                       |
