> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Producer Audios Generation API 連携説明

> Producer Music Generation API guide - Ace Data Cloud

本記事では、カスタムパラメータを入力して Producer 公式の音楽を生成できる Producer Audios Generation API の連携説明を紹介します。

## 申請フロー

Producer Audios Generation API を使用するには、まず [Ace Data Cloud コンソール](https://platform.acedata.cloud/console/applications) で API Token を取得し、予備として保管してください。

![](https://cdn.acedata.cloud/dvc3cg.jpg)

まだログインまたは登録していない場合は、自動的にログインページへ移動して登録とログインを案内され、完了後に現在のページへ自動的に戻ります。

**1つの API Token でプラットフォーム上のすべてのサービスを呼び出すことができ、サービスごとに個別申請する必要はありません。** 初回申請時には無料クレジットが付与され、無料で体験できます。クレジットが不足した場合は [コンソール](https://platform.acedata.cloud/console/coin) で共通残高をチャージできます。

> 📘 完全なドキュメント：[Producer Audios Generation API →](https://platform.acedata.cloud/documents/producer-audios)

## 基本的な使用方法

どのような曲を作りたいか、任意のテキストを入力できます。たとえばクリスマスに関する曲を生成したい場合は、`a song for Christmas` と入力できます。以下の図のとおりです。

<p>
  <img src="https://cdn.acedata.cloud/lg9bb0.png" width="600" className="m-auto" />
</p>

ここでは Request Headers を設定していることが確認できます。内容は以下のとおりです。

* `accept`：どの形式のレスポンス結果を受け取りたいか。ここでは `application/json`、つまり JSON 形式を指定します。
* `authorization`：API を呼び出すためのキー。申請後、直接プルダウンから選択できます。

また、Request Body のパラメータには以下が含まれます。

* `action`：今回の音楽生成タスクの動作。曲を生成する場合は `generate` です。
* `model`：曲の作成に使用するモデル。現在の主なものは： **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**。
* `lyric`：曲の歌詞内容。
* `custom`：カスタム方式で曲を生成するかどうか。
* `prompt`：インスピレーションモードでのプロンプト。
* `title`：曲のタイトル情報。
* `audio_id`：参照する曲の ID。続きを作成する、カバーするなどの操作に使用します。
* `continue_at`：指定した秒数から曲の続きを作成します。
* `replace_section_start`/`replace_section_end`：置換するセクションの開始時間と終了時間。単位は秒です。
* `lyrics_strength`：歌詞の強度。音声生成における歌詞の影響度を表します。0～1 の間で選択可能で、デフォルトは 0.7 です。
* `sound_strength`：音声プロンプトの強度。0.2～1 の間で選択可能で、デフォルトは 0.7 です。
* `cover_strength`：カバーの強度。0.2～1 の間で、デフォルトは 1 です。
* `weirdness`：スタイルの奇抜さ。0～1 の間で選択可能で、デフォルトは 0.5 です。
* `callback_url`：結果のコールバックを受け取る URL。
* `async`：任意。`true` に設定すると、インターフェースは直ちに `task_id` を返します。`callback_url` を指定する必要はなく、その後対応するタスク照会インターフェースを通じてポーリングし、結果を取得します。
* `instrumental`：歌詞なしモードかどうか。

選択後、右側にも対応するコードが生成されることが確認できます。以下の図のとおりです。

<p>
  <img src="https://cdn.acedata.cloud/0217zy.png" width="500" className="m-auto" />
</p>

「Try」ボタンをクリックするとテストできます。上図のとおり、ここでは以下の結果を取得しました。

```json theme={null}
{
  "success": true,
  "task_id": "82fd443a-903a-4f18-8028-12d2f8a0a4be",
  "trace_id": "d85839fa-0bb1-42da-a9fc-cd582c29027d",
  "data": [
    {
      "id": "6c947f13-a3c5-4b9c-8609-5639c37cdc2d",
      "title": "Untitled",
      "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
      "lyric": "[Instrumental]",
      "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
      "video_url": null,
      "image_id": "6c947f13-a3c5-4b9c-8609-5639c37cdc2d",
      "topic": null,
      "seed": "2450882164",
      "sound": "A song for Christmas",
      "created_at": "2025-12-30T17:18:23.232911Z",
      "model": "FUZZ-2.0 Pro",
      "progress": "100%",
      "state": "succeeded",
      "duration": "181.3014058956916"
    }
  ]
}
```

返却結果には複数のフィールドがあり、以下のとおりです。

* `success`、この時点の音楽生成タスクのステータス。
  * `data`、今回の音楽タスクの結果
    * `id`、この時点の音楽生成タスクの ID。
    * `sound`、この時点の音楽生成タスクのプロンプト。
    * `seed`、この時点の音楽生成タスクのシード値。
    * `audio_url`、この時点の音楽生成タスクの音声リンク。
    * `image_url`、この時点の音楽生成タスクのカバーリンク。
    * `image_id`、この時点の音楽生成タスクのカバー ID。
    * `state`、この時点の音楽生成タスクのステータス。
    * `duration`、この時点の音楽の再生時間情報。
    * `progress`、この時点の音楽タスクの進捗値。
    * `model`、この時点の音楽生成タスクで採用されているモデル情報。
    * `lyric`、この時点の音楽生成タスクの歌詞情報。

生成したい音楽情報を取得できたことが確認できます。結果の `data` にある音楽リンクアドレスに基づいて、生成された Producer 音楽を取得するだけです。

また、対応する連携コードを生成したい場合は、直接コピーして生成できます。たとえば CURL のコードは以下のとおりです。

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "generate",
  "model": "FUZZ-2.0 Pro",
  "prompt": "A song for Christmas"
}'
```

## カスタム生成

歌詞をカスタム生成したい場合は、歌詞を入力できます。

このとき、`lyric` フィールドには以下のような内容を渡すことができます。

```
[Verse]Woke up with the sun in my eyesNo clouds above just blue in the skiesShoes on my feet I’m ready to runEvery step feels like a loaded gun[Chorus]Happy days are rolling inLet the joy beneath my skinNo more shadows no more liesJust the truth that lifts me high[Verse 2]Dancing through the city streetsA rhythm pounding in my heartbeatStrangers smile it’s catching onThis world’s a stage we’re all a song[Chorus]Happy days are rolling inLet the joy beneath my skinNo more shadows no more liesJust the truth that lifts me high[Bridge]Throw your worries out the doorLet them sink to the ocean floorWe’re alive and it’s enoughLife is messy but it’s love[Chorus]Happy days are rolling inLet the joy beneath my skinNo more shadows no more liesJust the truth that lifts me high
```

続いて、歌詞、タイトル、スタイルに基づいて曲をカスタム生成するには、以下の内容を指定できます。

* lyric：歌詞テキスト
* custom：`true` を指定するとカスタム生成を表します。このパラメータのデフォルトは false であり、`prompt` を使用して生成することを表します。
* title：曲のタイトル。

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/ruovz5.png" width="500" className="m-auto" />
</p>

入力完了後、自動生成されたコードは以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/seyxxa.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "generate",
  "model": "FUZZ-2.0 Pro",
  "instrumental": false,
  "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
  "custom": true
}'
```

テストは許可されており、生成される結果は類似しています。

```json theme={null}
{
  "success": true,
  "task_id": "9f58bbd4-855a-4233-ac45-b63bf9168e02",
  "trace_id": "145ad117-6ce7-42dd-af12-70751c5284fc",
  "data": [
    {
      "id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
      "title": "Woke up with the sun in my eyes",
      "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
      "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
      "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
      "video_url": null,
      "image_id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
      "topic": null,
      "seed": "3789209121",
      "sound": "",
      "created_at": "2025-12-30T17:26:46.357055Z",
      "model": "FUZZ-2.0 Pro",
      "progress": "100%",
      "state": "succeeded",
      "duration": "153.80897959183673"
    }
  ]
}
```

## 楽曲のカバー

すでに生成された楽曲に対してカバー操作を行いたい場合は、上記で生成した楽曲を入力してカバーできます。次に、歌詞とタイトルに基づいて楽曲をカスタム生成します。

自分でアップロードした楽曲をさらにカバーしたい場合は、パラメータ `action` を `upload_cover` に設定し、さらにカバーするためにカスタムアップロードした楽曲 ID を入力できます。楽曲 ID の取得には [Producer Upload API](https://platform.acedata.cloud/documents/producer-upload) を使用します。以下の図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/z7r5fd.png" width="500" className="m-auto" />
</p>

以下の内容を指定できます：

* action：今回の楽曲タスクの動作です。現在対応しているものは：generate、cover、extend、upload\_cover、upload\_extend、replace\_section、swap\_vocals、swap\_instrumentals、variation です。今回のカバーでは `cover` パラメータを使用します。
* lyric：歌詞テキスト
* title：曲のタイトル。
* custom：カスタムモードで生成するかどうかです。デフォルトは false です。
* audio\_id：カバーする楽曲の楽曲 ID。

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/6xl82z.png" width="500" className="m-auto" />
</p>

入力完了後、自動生成されたコードは以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/bxzfrw.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "cover",
  "model": "FUZZ-2.0 Pro",
  "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
  "audio_id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
  "instrumental": false,
  "custom": true,
  "title": "Cover"
}'
```

テストは許可されており、生成される結果は類似しています。

```json theme={null}
{
  "success": true,
  "task_id": "dbca350e-6fb9-46ca-9c7e-4c1a9080806f",
  "trace_id": "a39e0fff-ced8-4b31-ae23-aef3badd90fa",
  "data": [
    {
      "id": "e52dd729-38b4-4c2f-9031-59eb7953c593",
      "title": "Cover",
      "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
      "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
      "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
      "video_url": null,
      "image_id": "e52dd729-38b4-4c2f-9031-59eb7953c593",
      "topic": null,
      "seed": "358803418",
      "sound": "",
      "created_at": "2025-12-30T17:32:32.951948Z",
      "model": "FUZZ-2.0 Pro",
      "progress": "100%",
      "state": "succeeded",
      "duration": "153.0659410430839"
    }
  ]
}
```

## 楽曲の続きの作成

楽曲の続きを作成したい場合は、`action`パラメータ値として`extend`を渡す必要があります。次に、歌詞、タイトル、スタイルに基づいて楽曲をカスタム生成します。

自分でアップロードした楽曲の続きを作成したい場合は、パラメータ `action` を `upload_extend` に設定し、続きの作成が必要なカスタムアップロード済み楽曲の ID を入力できます。楽曲 ID は [Producer Upload API](https://platform.acedata.cloud/documents/producer-upload)を使用して取得します。以下の図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/z7r5fd.png" width="500" className="m-auto" />
</p>

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/r3ux6z.png" width="500" className="m-auto" />
</p>

入力が完了すると、以下のコードが自動生成されます：

<p>
  <img src="https://cdn.acedata.cloud/fsww0u.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "extend",
  "model": "FUZZ-2.0 Pro",
  "instrumental": false,
  "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
  "continue_at": 3,
  "audio_id": "38d3b9e2-0dfb-4338-b2a7-15e45656ed32",
  "custom": true,
  "title": "Extend",
  "weirdness": 0.3,
  "sound_strength": 0.3,
  "lyrics_strength": 0.6
}'
```

テストは許可されており、生成される結果は類似しています。

```json theme={null}
{
  "success": true,
  "task_id": "834983cb-d62d-4750-b1aa-461da137e51f",
  "trace_id": "6923eee2-7403-432c-8bd1-e471086385b0",
  "data": [
    {
      "id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
      "title": "Extend",
      "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
      "lyric": "[Verse]\n[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
      "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
      "video_url": null,
      "image_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
      "topic": null,
      "seed": "4294469624",
      "sound": "",
      "created_at": "2025-12-30T17:36:14.520928Z",
      "model": "FUZZ-2.0 Pro",
      "progress": "100%",
      "state": "succeeded",
      "duration": "173.87102040816328"
    }
  ]
}
```

## 音楽のバリエーション

前の楽曲のseed値に基づいて類似した効果の新しい音楽を生成したい場合は、`action`パラメータ値として`variation`を渡す必要があります。続いて、類似した効果の新しい音楽をカスタム生成できます。

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/bxslxt.png" width="500" className="m-auto" />
</p>

入力が完了すると、以下のコードが自動生成されます：

<p>
  <img src="https://cdn.acedata.cloud/nojowk.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "variation",
  "audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
  "model": "FUZZ-2.0 Pro",
  "instrumental": false,
  "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
  "custom": true
}'
```

テストは可能で、生成される効果は類似しています。

```json theme={null}
{
    "success": true,
    "task_id": "3a74da6d-a37d-4b5d-b116-821f455bce39",
    "trace_id": "8e28cce0-0400-4bfd-83db-6d27f97422c7",
    "data": [
        {
            "id": "c14ca458-cd5a-4700-83d4-5249e15f2707",
            "title": "Woke up with the sun in my eyes",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "c14ca458-cd5a-4700-83d4-5249e15f2707",
            "topic": null,
            "seed": "2082104582",
            "sound": "",
            "created_at": "2025-12-30T17:48:40.135187Z",
            "model": "FUZZ-2.0",
            "progress": "100%",
            "state": "succeeded",
            "duration": "173.12798185941043"
        }
    ]
}
```

## セクションの置換

楽曲のセクションを置換したい場合は、`action`パラメータの値として`replace_section`を渡す必要があります。続いて、歌詞やタイトルに基づいて楽曲をカスタム生成します。

自分でアップロードした楽曲のセクションを引き続き置換したい場合は、パラメータ `action` を `upload_replace_section` に設定し、さらにカスタムアップロードした楽曲の続きを書くための楽曲 ID を入力します。楽曲 ID の取得には [Producer Upload API](https://platform.acedata.cloud/documents/producer-upload)を使用します。以下の図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/z7r5fd.png" width="500" className="m-auto" />
</p>

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/mzo9iw.png" width="500" className="m-auto" />
</p>

入力完了後、以下のコードが自動生成されます：

<p>
  <img src="https://cdn.acedata.cloud/877x6c.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "replace_section",
  "model": "FUZZ-2.0 Pro",
  "instrumental": false,
  "lyric": "[Verse]\\nWoke up with the sun in my eyes\\nNo clouds above just blue in the skies\\nShoes on my feet I’m ready to run\\nEvery step feels like a loaded gun\\n[Chorus]\\nHappy days are rolling in\\nLet the joy beneath my skin\\nNo more shadows no more lies\\nJust the truth that lifts me high\\n[Verse 2]\\nDancing through the city streets\\nA rhythm pounding in my heartbeat\\nStrangers smile it’s catching on\\nThis world’s a stage we’re all a song\\n[Chorus]\\nHappy days are rolling in\\nLet the joy beneath my skin\\nNo more shadows no more lies\\nJust the truth that lifts me high\\n[Bridge]\\nThrow your worries out the door\\nLet them sink to the ocean floor\\nWe’re alive and it’s enough\\nLife is messy but it’s love\\n[Chorus]\\nHappy days are rolling in\\nLet the joy beneath my skin\\nNo more shadows no more lies\\nJust the truth that lifts me high",
  "audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
  "replace_section_start": 3,
  "replace_section_end": 70,
  "custom": true
}'
```

テストは可能で、生成される効果は類似しています。

```json theme={null}
{
    "success": true,
    "task_id": "3cb5ae96-01b0-4a37-afb0-e582608af56f",
    "trace_id": "3ebc6f63-5093-4499-bf9b-95c239e0da4f",
    "data": [
        {
            "id": "a54609c6-13e2-4176-be0f-4d7eebc68e1f",
            "title": "Woke up with the sun in my eyes",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[Verse]\\nWoke up with the sun in my eyes\\nNo clouds above just blue in the skies\\nShoes on my feet I’m ready to run\\nEvery step feels like a loaded gun\\n[Chorus]\\nHappy days are rolling in\\nLet the joy beneath my skin\\nNo more shadows no more lies\\nJust the truth that lifts me high\\n[Verse 2]\\nDancing through the city streets\\nA rhythm pounding in my heartbeat\\nStrangers smile it’s catching on\\nThis world’s a stage we’re all a song\\n[Chorus]\\nHappy days are rolling in\\nLet the joy beneath my skin\\nNo more shadows no more lies\\nJust the truth that lifts me high\\n[Bridge]\\nThrow your worries out the door\\nLet them sink to the ocean floor\\nWe’re alive and it’s enough\\nLife is messy but it’s love\\n[Chorus]\\nHappy days are rolling in\\nLet the joy beneath my skin\\nNo more shadows no more lies\\nJust the truth that lifts me high",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "a54609c6-13e2-4176-be0f-4d7eebc68e1f",
            "topic": null,
            "seed": "14887454",
            "sound": "",
            "created_at": "2025-12-30T18:01:19.907443Z",
            "model": "FUZZ-2.0 Pro",
            "progress": "100%",
            "state": "succeeded",
            "duration": "174.6140589569161"
        }
    ]
}
```

## 伴奏カバー

公式の伴奏カバー操作を使用したい場合は、`action`パラメータ値を`swap_instrumentals`に設定できます。続いて、歌詞とタイトルに基づいてカスタムで曲を生成します。

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/7l6976.png" width="500" className="m-auto" />
</p>

入力が完了すると、以下のコードが自動生成されます：

<p>
  <img src="https://cdn.acedata.cloud/pvi2n3.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "swap_instrumentals",
  "model": "FUZZ-2.0 Pro",
  "weirdness": 0.6,
  "prompt": "Happy",
  "audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4"
}'
```

テストは成功し、生成された結果は類似しています。

```json theme={null}
{
  "success": true,
  "task_id": "d17d8376-3a58-451d-a976-404719bac11d",
  "trace_id": "ab596807-910a-4e30-bae2-4647895f7d0b",
  "data": [
    {
      "id": "22d7d75c-9e0a-47a8-b22b-eea55eaa0c4b",
      "title": "Extend (Sound swap)",
      "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
      "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
      "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
      "video_url": null,
      "image_id": "22d7d75c-9e0a-47a8-b22b-eea55eaa0c4b",
      "topic": null,
      "seed": "2157878068",
      "sound": "Happy",
      "created_at": "2025-12-30T18:09:49.594800Z",
      "model": "FUZZ-2.0 Pro",
      "progress": "100%",
      "state": "succeeded",
      "duration": "172.3849433106576"
    }
  ]
}
```

## ボーカルカバー

公式のボーカルカバー操作を使用したい場合は、`action`パラメータ値を`swap_vocals`に設定できます。続いて、歌詞、タイトル、スタイルに基づいてカスタムで曲を生成します。

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/bk9ino.png" width="500" className="m-auto" />
</p>

入力が完了すると、以下のコードが自動生成されます：

<p>
  <img src="https://cdn.acedata.cloud/p5b1vg.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "swap_vocals",
  "model": "FUZZ-2.0 Pro",
  "instrumental": false,
  "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
  "weirdness": 0.6,
  "lyrics_strength": 0.8,
  "audio_id": "d9ebc609-fb65-4a23-b914-c074747af6a4",
  "custom": true
}'
```

テストは成功し、生成された結果は類似しています。

```json theme={null}
{
  "success": true,
  "task_id": "a903ac38-f129-4f85-9181-b1dc5579bd32",
  "trace_id": "9953af52-45e0-4808-bf13-88f0b21262c1",
  "data": [
    {
      "id": "7b2d653b-aaaa-41b0-b737-aee4c4c5693b",
      "title": "Woke up with the sun in my eyes",
      "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
      "lyric": "[Verse]\nWoke up with the sun in my eyes\nNo clouds above just blue in the skies\nShoes on my feet I’m ready to run\nEvery step feels like a loaded gun\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Verse 2]\nDancing through the city streets\nA rhythm pounding in my heartbeat\nStrangers smile it’s catching on\nThis world’s a stage we’re all a song\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high\n[Bridge]\nThrow your worries out the door\nLet them sink to the ocean floor\nWe’re alive and it’s enough\nLife is messy but it’s love\n[Chorus]\nHappy days are rolling in\nLet the joy beneath my skin\nNo more shadows no more lies\nJust the truth that lifts me high",
      "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
      "video_url": null,
      "image_id": "7b2d653b-aaaa-41b0-b737-aee4c4c5693b",
      "topic": null,
      "seed": "2484735707",
      "sound": "",
      "created_at": "2025-12-30T18:13:01.349875Z",
      "model": "FUZZ-2.0 Pro",
      "progress": "100%",
      "state": "succeeded",
      "duration": "173.12798185941043"
    }
  ]
}
```

## ボーカルと曲の分離

公式のボーカルと曲の分離操作を使用したい場合は、`action` パラメータの値を `stems` に設定します。次に、楽曲 ID に基づいてボーカルと曲を分離します。

入力例は以下のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/fnpgvc.png" width="500" className="m-auto" />
</p>

入力が完了すると、以下のコードが自動生成されます：

<p>
  <img src="https://cdn.acedata.cloud/oq5iv5.png" width="500" className="m-auto" />
</p>

対応するコード：

```shell theme={null}
curl -X POST 'https://api.acedata.cloud/producer/audios' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "stems",
  "audio_id": "a54609c6-13e2-4176-be0f-4d7eebc68e1f"
}'
```

テストは可能で、生成される結果も類似しています。

```json theme={null}
{
    "success": true,
    "task_id": "561ac695-b4aa-47cf-978d-fb7be2b9ebfc",
    "trace_id": "66d0d397-2987-4bde-84fb-a60d0023b217",
    "data": [
        {
            "title": "Woke up with the sun in my eyes",
            "lyric": "",
            "stems_url": "https://platform.cdn.acedata.cloud/producer/561ac695-b4aa-47cf-978d-fb7be2b9ebfc.zip",
            "model": "",
            "progress": "100%",
            "state": "succeeded"
        }
    ]
}
```

## 非同期コールバック

Producer Audios Generation API の生成には比較的長い時間がかかる場合があります。API が長時間応答しない場合、HTTP リクエストは接続を維持し続け、追加のシステムリソースを消費するため、本 API では非同期コールバックもサポートしています。

全体の流れは次のとおりです：クライアントがリクエストを開始する際に、追加で `callback_url` フィールドを指定します。クライアントが API リクエストを開始すると、API は `task_id` フィールド情報を含む結果を直ちに返します。これは現在のタスク ID を表します。タスクが完了すると、生成タスクの結果が POST JSON の形式でクライアントが指定した `callback_url` に送信され、その中にも `task_id` フィールドが含まれるため、タスク結果を ID で関連付けることができます。

以下では、例を通じて具体的な操作方法を確認します。

まず、Webhook コールバックは HTTP リクエストを受信できるサービスです。開発者は自身で構築した HTTP サーバーの URL に置き換える必要があります。ここではデモの便宜上、公開 Webhook サンプルサイト [https://webhook.site/](https://webhook.site/) を使用します。このサイトを開くと、図のように Webhook URL を取得できます：

![](https://cdn.acedata.cloud/tbcnai.png)

この URL をコピーすれば、Webhook として使用できます。ここでの例は [https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1](https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1) です。

次に、フィールド `callback_url` を上記の Webhook URL に設定し、同時に対応するパラメータを入力します。具体的な内容は図のとおりです：

<p>
  <img src="https://cdn.acedata.cloud/wuzd4y.png" width="500" className="m-auto" />
</p>

実行をクリックすると、以下のようにすぐに結果が得られることがわかります：

```
{
  "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad"
}
```

しばらく待つと、[https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1](https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1) で生成タスクの結果を確認できます。図のとおりです：

![](https://cdn.acedata.cloud/k0kf0y.png)

内容は以下のとおりです：

```json theme={null}
{
    "success": true,
    "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
    "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
    "data": [
        {
            "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "title": "目覚めると太陽が目に差し込んでいた",
            "image_url": "https://cdn.acedata.cloud/e724d7f13d.png",
            "lyric": "[Verse]\n目覚めると太陽が目に差し込んでいた\n頭上に雲はなく 空はただ青い\n足に靴を履いて 走る準備はできている\n一歩一歩が装填された銃のように感じる\n[Chorus]\n幸せな日々が訪れている\n肌の下に喜びを感じさせて\nもう影も もう嘘もない\nただ私を高く舞い上げる真実だけ\n[Verse 2]\n街の通りを踊りながら進む\n心臓の鼓動にリズムが打ち鳴らされる\n見知らぬ人々が笑顔を見せ それが広がっていく\nこの世界は舞台で 私たちは皆歌なの\n[Chorus]\n幸せな日々が訪れている\n肌の下に喜びを感じさせて\nもう影も もう嘘もない\nただ私を高く舞い上げる真実だけ\n[Bridge]\n心配事をドアの外へ投げ出して\nそれらを海の底に沈めよう\n私たちは生きていて それで十分\n人生は散らかっているけれど 愛なの\n[Chorus]\n幸せな日々が訪れている\n肌の下に喜びを感じさせて\nもう影も もう嘘もない\nただ私を高く舞い上げる真実だけ",
            "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3",
            "video_url": null,
            "image_id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "topic": null,
            "seed": "1490770667",
            "sound": "",
            "created_at": "2025-12-30T18:36:00.994141Z",
            "model": "FUZZ-2.0 Pro",
            "progress": "100%",
            "state": "succeeded",
            "duration": "135.2330158730159"
        }
    ]
}
```

結果には `task_id` フィールドがあることが確認できます。その他のフィールドは上記と類似しており、このフィールドによってタスクの関連付けを実現できます。

## エラー処理

API を呼び出す際にエラーが発生した場合、API は対応するエラーコードと情報を返します。例：

* `400 token_mismatched`：不正なリクエスト。パラメータの欠落または無効が原因である可能性があります。
* `400 api_not_implemented`：不正なリクエスト。パラメータの欠落または無効が原因である可能性があります。
* `401 invalid_token`：未認証。認証トークンが無効または欠落しています。
* `429 too_many_requests`：リクエストが多すぎます。レート制限を超過しています。
* `500 api_error`：内部サーバーエラー。サーバーで問題が発生しました。

### エラーレスポンスの例

```json theme={null}
{
  "success": false,
  "error": {
    "code": "api_error",
    "message": "fetch failed"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
```

## 結論

本ドキュメントを通じて、Producer Audios Generation API を使用してプロンプトを入力することで音楽を生成する方法を理解できました。本ドキュメントが、この API との連携および使用により役立つことを願っています。ご質問がある場合は、いつでも当社の技術サポートチームにお問い合わせください。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.