Producer Audios Generation API 連携ガイド

本文では、カスタムパラメータを入力することで Producer 公式の音楽を生成できる Producer Audios Generation API の連携方法を紹介します。

申請手順

Producer Audios Generation API を使用するには、まず AI 聚合コンソール にアクセスして API Token を取得し、後で使用できるようにしておきます。

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

汎用アプリケーションの API Key は、アカウントで利用が有効になっているサービスに使用できます。専用アプリケーションの Key は、そのアプリケーションのサービス範囲に応じて使用します。Key の権限、有効期限、上限を確認し、アプリケーションの残高が今回のリクエストの支払いに十分であることを確認してください。利用可能な試用クレジットはアカウントに表示される内容に従い、残高が不足している場合は「チャージ」ボタンをクリックしてください。

📘 完全なドキュメント:Producer Audios Generation API →

操作に応じた必須パラメータの選択

action=generate かつ custom=false(デフォルト)の場合は prompt を指定します。custom=true かつ instrumental=false の場合は lyric を指定します。カスタムインストゥルメンタルでは custom=true, instrumental=true を設定でき、架空の歌詞や追加のプロンプトは不要です。 action=extend には audio_id と 0 より大きい continue_at が必要で、インストゥルメンタル以外のモードでは lyric も必要です。カバー、バリエーション、セクションの置換、パートの交換、トラックの分離にはいずれも元の audio_id が必要です。 歌詞とプロンプトをすべての操作で無条件に必須とするべきではありません。

MCP では、producer_extend_music と producer_replace_section に lyric を指定すると、 カスタム歌詞モードが選択されます。インストゥルメンタルの続きの生成では、instrumental=true を指定し、歌詞を省略できます。

基本的な使い方

どのような曲にしたいか、任意の文章を入力できます。例えば、クリスマスに関する曲を生成したい場合は、図のように a song for Christmas と入力できます。

ここでは Request Headers を設定しており、以下が含まれます。

  • accept:どのような形式のレスポンス結果を受け取りたいかを指定します。ここでは JSON 形式の application/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.5 です。
  • sound_strength:音声プロンプトの強度です。0.2~1 の間で指定でき、デフォルトは 0.5 です。
  • cover_strength:カバーの強度です。0.2~1 の間で指定でき、デフォルトは 1 です。
  • weirdness:スタイルの奇抜さです。0~1 の間で指定でき、デフォルトは 0.5 です。
  • callback_url:結果のコールバック先 URL です。
  • async:オプションです。true に設定すると、インターフェースは直ちに task_id を返し、callback_url を指定する必要はありません。その後、対応するタスク照会インターフェースをポーリングして結果を取得します。
  • instrumental:歌詞なしのモードにするかどうかです。

選択すると、図のように右側にも対応するコードが生成されます。

「Try」ボタンをクリックするとテストできます。上図のように、ここでは以下の結果が得られました。

{
  "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 のコードは以下のとおりです。

curl -X POST 'https://api.yxai-tech.top/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:曲のタイトル。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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
}'

テストが許可され、生成結果は同様になります。

{
  "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 を使用して取得します。以下の図のとおりです:

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

  • action:今回の曲タスクの動作。現在サポートされているのは、generate、cover、extend、upload_cover、upload_extend、replace_section、swap_vocals、swap_instrumentals、variation です。今回のカバーには cover パラメータを使用します。
  • lyric:歌詞テキスト
  • title:曲のタイトル。
  • custom:カスタムモードで生成するかどうか。デフォルトは false です。
  • audio_id:カバーする曲の曲 ID。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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"
}'

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

{
  "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を使用して取得します。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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
}'

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

{
  "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を指定する必要があります。次に、似た効果の新しい楽曲をカスタマイズして生成できます。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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
}'

テストが許可され、生成された結果は似ています。

{
    "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を使用して取得します:

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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
}'

テストが許可され、生成された結果は似ています。

{
    "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に設定できます。次に、歌詞とタイトルに基づいて楽曲をカスタム生成します。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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"
}'

テストが許可され、生成された結果は似ています。

{
  "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に設定できます。次に、歌詞、タイトル、スタイルに基づいて楽曲をカスタム生成します。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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
}'

テストが許可され、生成された結果は似ています。

{
  "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に基づいてボーカルと伴奏を分離します。

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

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

対応するコード:

curl -X POST 'https://api.yxai-tech.top/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"
}'

テストが許可され、生成結果は同様になります。

{
    "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 はすぐに結果を返します。この結果には、現在のタスク ID を表す task_id フィールドが含まれます。タスクが完了すると、生成タスクの結果が POST JSON の形式でクライアント指定の callback_url に送信されます。そこにも task_id フィールドが含まれるため、タスクの結果を ID で関連付けることができます。

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

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

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

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

実行をクリックすると、以下のような結果がすぐに得られます:

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

しばらく待つと、https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1 で、図のように生成タスクの結果を確認できます:

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

{
    "success": true,
    "task_id": "1a6ac2ad-10f2-4e2b-b500-66ec27fe82ad",
    "trace_id": "1da03537-4eb8-410d-b849-43f03085a3bb",
    "data": [
        {
            "id": "1dd08826-478e-43a6-868f-aff5ababac2c",
            "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": "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:内部サーバーエラーです。サーバーで問題が発生しました。

エラーレスポンスの例

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

結論

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