Anleitung zur Integration der Producer Audios Generation API

Dieser Artikel stellt eine Anleitung zur Integration der Producer Audios Generation API vor, mit der sich durch die Eingabe benutzerdefinierter Parameter offizielle Producer-Musik erzeugen lässt.

Beantragungsverfahren

Um die Producer Audios Generation API zu nutzen, rufen Sie zunächst die 零壹AI-Konsole auf, um Ihren API-Token abzurufen und für später bereitzuhalten.

Falls Sie noch nicht angemeldet oder registriert sind, werden Sie automatisch zur Anmeldeseite weitergeleitet, wo Sie sich registrieren und anmelden können. Anschließend kehren Sie automatisch zur aktuellen Seite zurück.

Der API-Schlüssel einer allgemeinen Anwendung kann für die Dienste verwendet werden, die für das Konto freigeschaltet sind; der Schlüssel einer dedizierten Anwendung wird entsprechend dem Dienstumfang dieser Anwendung verwendet. Bitte prüfen Sie die Berechtigungen, die Gültigkeitsdauer und die Limits des Schlüssels und stellen Sie sicher, dass das Anwendungsguthaben für die Bezahlung dieser Anfrage ausreicht. Das verfügbare Testguthaben richtet sich nach der Anzeige im Konto. Bei unzureichendem Guthaben klicken Sie einfach auf die Schaltfläche „Aufladen“.

📘 Vollständige Dokumentation: Producer Audios Generation API →

Pflichtparameter nach Aktion auswählen

Bei action=generate und custom=false (Standard) geben Sie prompt an; bei custom=true und instrumental=false geben Sie lyric an. Für benutzerdefinierte Instrumentalmusik können Sie custom=true, instrumental=true setzen, ohne Liedtext oder zusätzliche Prompts erfinden zu müssen. action=extend erfordert audio_id und einen Wert für continue_at, der größer als 0 ist; im Modus mit Liedtext ist außerdem lyric erforderlich. Coverversionen, Varianten, das Ersetzen von Abschnitten, der Austausch von Stimmen und die Trennung von Audiospuren erfordern jeweils die audio_id der Quelle; Liedtexte und Prompts sollten nicht für alle Aktionen bedingungslos erforderlich sein.

In MCP wählen producer_extend_music und producer_replace_section bei Angabe von lyric den Modus für benutzerdefinierte Liedtexte; für die Fortsetzung von Instrumentalmusik kann instrumental=true übergeben und der Liedtext weggelassen werden.

Grundlegende Verwendung

Sie können beliebigen Text eingeben, um zu beschreiben, welches Lied Sie sich vorstellen. Wenn ich beispielsweise ein Lied über Weihnachten erzeugen möchte, kann ich ein Lied für Weihnachten eingeben, wie in der Abbildung gezeigt:

Hier haben wir die Request Headers festgelegt, darunter:

  • accept: Das gewünschte Format des Antwortergebnisses; hier wird application/json, also das JSON-Format, eingetragen.
  • authorization: Der Schlüssel für den API-Aufruf, der nach der Beantragung direkt über das Dropdown-Menü ausgewählt werden kann.

Die Parameter des Request Body umfassen außerdem:

  • action: Die Aktion dieser Musikgenerierungsaufgabe; für die Erzeugung eines Liedes ist dies generate.
  • model: Das zur Erstellung des Liedes verwendete Modell; derzeit gibt es hauptsächlich: 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: Der Liedtext.
  • custom: Ob das Lied auf benutzerdefinierte Weise erzeugt werden soll.
  • prompt: Der Prompt im Inspirationsmodus.
  • title: Der Titel des Liedes.
  • audio_id: Die ID des Referenzliedes für Aktionen wie Fortsetzungen oder Coverversionen.
  • continue_at: Das Lied ab der angegebenen Sekunde fortsetzen.
  • replace_section_start/replace_section_end: Beginn und Ende des zu ersetzenden Abschnitts in Sekunden.
  • lyrics_strength: Die Liedtextstärke, die den Einfluss des Liedtextes auf die Audioerzeugung angibt; wählbar zwischen 0 und 1, Standardwert 0,5.
  • sound_strength: Die Stärke des Audio-Prompts; wählbar zwischen 0,2 und 1, Standardwert 0,5.
  • cover_strength: Die Coverstärke zwischen 0,2 und 1, Standardwert 1.
  • weirdness: Die Ungewöhnlichkeit des Stils; wählbar zwischen 0 und 1, Standardwert 0,5
  • callback_url: Die URL für die Rückgabe des Ergebnisses.
  • async: Optional; bei Einstellung auf true gibt die Schnittstelle sofort eine task_id zurück, ohne dass eine callback_url angegeben werden muss. Anschließend wird das Ergebnis über die entsprechende Aufgabenabfrageschnittstelle per Polling abgerufen.
  • instrumental: Ob der Modus ohne Liedtext verwendet werden soll.

Nach der Auswahl wird auf der rechten Seite auch der entsprechende Code erzeugt, wie in der Abbildung gezeigt:

Klicken Sie auf die Schaltfläche „Try“, um einen Test durchzuführen. Wie in der obigen Abbildung gezeigt, erhalten wir hier das folgende Ergebnis:

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

Das Ergebnis enthält mehrere Felder, die im Folgenden erläutert werden:

  • success, der Status der Musikgenerierungsaufgabe.
    • data, das Ergebnis dieser Musikaufgabe
      • id, die ID der Musikgenerierungsaufgabe.
      • sound, der Prompt der Musikgenerierungsaufgabe.
      • seed, der Seed-Wert der Musikgenerierungsaufgabe.
      • audio_url, der Audiolink der Musikgenerierungsaufgabe.
      • image_url, der Coverlink der Musikgenerierungsaufgabe.
      • image_id, die Cover-ID der Musikgenerierungsaufgabe.
      • state, der Status der Musikgenerierungsaufgabe.
      • duration, die Dauer der Musik.
      • progress, der Fortschrittswert der Musikaufgabe.
      • model, das für die Musikgenerierungsaufgabe verwendete Modell.
      • lyric, der Liedtext der Musikgenerierungsaufgabe.

Wir haben die Informationen zur gewünschten Musik erhalten und müssen die erzeugte Producer-Musik lediglich über den Musiklink unter data im Ergebnis abrufen.

Wenn Sie außerdem den entsprechenden Integrationscode erzeugen möchten, können Sie den generierten Code direkt kopieren. Der CURL-Code sieht beispielsweise wie folgt aus:

curl -X POST 'https://api.01ai.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"
}'

Benutzerdefinierte Generierung

Wenn Sie einen Liedtext für die benutzerdefinierte Generierung verwenden möchten, können Sie ihn eingeben: In diesem Fall kann das Feld lyric mit einem Inhalt wie dem folgenden befüllt werden:

[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

Als Nächstes möchten wir anhand des Liedtexts, des Titels und des Stils einen Song individuell generieren. Dazu können die folgenden Angaben gemacht werden:

  • lyric: Liedtext
  • custom: Auf true setzen, um eine individuelle Generierung anzugeben. Der Standardwert dieses Parameters ist false, was bedeutet, dass prompt zur Generierung verwendet wird.
  • title: Der Titel des Songs.

Ein Beispiel für die Eingabe:

Nach Abschluss der Eingabe wurde automatisch der folgende Code generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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
}'

Beim Test ist das generierte Ergebnis ähnlich.

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

Songs covern

Wenn Sie einen bereits generierten Song covern möchten, können Sie den oben generierten Song zum Covern eingeben. Als Nächstes möchten wir anhand des Liedtexts und des Titels einen Song individuell generieren.

Wenn Sie einen selbst hochgeladenen Song covern möchten, können Sie den Parameter action auf upload_cover setzen und die ID des individuell hochgeladenen Songs eingeben, der gecovert werden soll. Die Song-ID wird mithilfe der Producer Upload API abgerufen, wie in der folgenden Abbildung gezeigt:

Dabei können die folgenden Angaben gemacht werden:

  • action: Die Aktion für diesen Song-Auftrag. Derzeit werden generate, cover, extend, upload_cover, upload_extend, replace_section, swap_vocals, swap_instrumentals und variation unterstützt. Für dieses Cover wird der Parameter cover verwendet.
  • lyric: Liedtext
  • title: Der Titel des Songs.
  • custom: Gibt an, ob im individuellen Modus generiert werden soll. Der Standardwert ist false.
  • audio_id: Die Song-ID des Songs, der gecovert werden soll.

Ein Beispiel für die Eingabe:

Nach Abschluss der Eingabe wurde automatisch der folgende Code generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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"
}'

Der Test ist zulässig, das erzeugte Ergebnis ist ähnlich.

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

Song fortsetzen

Wenn wir einen Song fortsetzen möchten, müssen wir den Wert des Parameters action als extend übergeben. Anschließend können wir den Song anhand von Liedtext, Titel und Stil individuell generieren.

Wenn wir einen selbst hochgeladenen Song weiter fortsetzen möchten, können wir den Parameter action auf upload_extend setzen und die ID des individuell hochgeladenen Songs eingeben, der weiter fortgesetzt werden soll. Die Song-ID wird mithilfe der Producer Upload API abgerufen, wie in der folgenden Abbildung gezeigt:

Ein Beispiel für die Eingabe:

Nach dem Ausfüllen wird der folgende Code automatisch generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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
}'

Der Test ist zulässig, das erzeugte Ergebnis ist ähnlich.

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

Musikvariation

Wenn wir anhand des Seed-Werts des vorherigen Musikstücks ein neues Musikstück mit ähnlichem Effekt generieren möchten, müssen wir den Wert des Parameters action als variation übergeben. Anschließend können wir ein neues Musikstück mit ähnlichem Effekt individuell generieren.

Ein Beispiel für die Eingabe:

Nach dem Ausfüllen wird der folgende Code automatisch generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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
}'

Der Test ist zulässig, das erzeugte Ergebnis ist ähnlich.

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

Abschnitt ersetzen

Wenn wir einen Abschnitt eines Songs ersetzen möchten, müssen wir für den Parameter action den Wert replace_section übergeben. Anschließend müssen wir den Song anhand des Liedtexts und des Titels individuell generieren.

Wenn wir weiterhin Abschnitte eines selbst hochgeladenen Songs ersetzen möchten, können wir den Parameter action auf upload_replace_section setzen und die ID des individuell hochgeladenen Songs eingeben, der weitergeschrieben werden soll. Die Song-ID wird mithilfe der Producer Upload API abgerufen, wie in der folgenden Abbildung gezeigt:

Ein Beispiel für die Eingabe sieht wie folgt aus:

Nach Abschluss der Eingabe wird automatisch folgender Code generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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
}'

Der Test ist zulässig, das erzeugte Ergebnis ist ähnlich.

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

Begleitung austauschen

Wenn Sie die offizielle Funktion zum Austauschen der Begleitung verwenden möchten, können Sie den Wert des Parameters action auf swap_instrumentals setzen. Als Nächstes werden wir anhand des Liedtexts und des Titels einen Song nach eigenen Vorgaben generieren.

Ein Beispiel für die Eingabe sieht wie folgt aus:

Nach Abschluss der Eingabe wurde automatisch der folgende Code generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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"
}'

Der Test war erfolgreich, das generierte Ergebnis ist ähnlich.

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

Gesang austauschen

Wenn Sie die offizielle Funktion zum Austauschen des Gesangs verwenden möchten, können Sie den Wert des Parameters action auf swap_vocals setzen. Als Nächstes werden wir anhand des Liedtexts, des Titels und des Stils einen Song nach eigenen Vorgaben generieren.

Ein Beispiel für die Eingabe sieht wie folgt aus:

Nach Abschluss der Eingabe wurde automatisch der folgende Code generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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
}'

Der Test war erfolgreich, das generierte Ergebnis ist ähnlich.

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

Trennung von Gesang und Musik

Wenn Sie die offizielle Funktion zur Trennung von Gesang und Musik verwenden möchten, können Sie den Wert des Parameters action auf stems setzen. Anschließend trennen wir Gesang und Musik anhand der Song-ID.

Ein Beispiel für die Eingabe:

Nach Abschluss der Eingabe wurde automatisch folgender Code generiert:

Der entsprechende Code:

curl -X POST 'https://api.01ai.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"
}'

Der Test war erfolgreich, das generierte Ergebnis sieht ähnlich aus.

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

Asynchroner Rückruf

Da die Generierung über die Producer Audios Generation API manchmal relativ lange dauern kann, bleibt die HTTP-Verbindung bestehen, wenn die API längere Zeit nicht antwortet, was zu zusätzlichem Verbrauch von Systemressourcen führt. Daher unterstützt diese API auch asynchrone Rückrufe.

Der gesamte Ablauf ist wie folgt: Wenn der Client eine Anfrage stellt, gibt er zusätzlich ein Feld callback_url an. Nachdem der Client die API-Anfrage gestellt hat, gibt die API sofort ein Ergebnis zurück, das ein Feld task_id enthält, welches die aktuelle Aufgaben-ID bezeichnet. Sobald die Aufgabe abgeschlossen ist, wird das Ergebnis der Generierungsaufgabe als POST-JSON an die vom Client angegebene callback_url gesendet. Es enthält ebenfalls das Feld task_id, sodass die Aufgabenergebnisse über die ID zugeordnet werden können.

Im Folgenden betrachten wir anhand eines Beispiels, wie dies konkret funktioniert.

Zunächst ist ein Webhook-Rückruf ein Dienst, der HTTP-Anfragen empfangen kann. Entwickler sollten die URL durch die ihres selbst eingerichteten HTTP-Servers ersetzen. Zur einfacheren Demonstration verwenden wir hier eine öffentliche Webhook-Beispielwebsite https://webhook.site/. Nach dem Öffnen der Website erhält man eine Webhook-URL, wie in der Abbildung gezeigt:

Kopieren Sie diese URL, um sie als Webhook zu verwenden. Das Beispiel lautet hier https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1.

Anschließend können wir das Feld callback_url auf die obige Webhook-URL setzen und gleichzeitig die entsprechenden Parameter eingeben. Die genauen Inhalte sind in der Abbildung dargestellt:

Klicken Sie auf „Ausführen“, und Sie erhalten sofort ein Ergebnis wie dieses:

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

Nach einer kurzen Wartezeit können wir das Ergebnis der Generierungsaufgabe unter https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1 sehen, wie in der Abbildung gezeigt:

Der Inhalt lautet wie folgt:

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

Im Ergebnis ist ein Feld task_id zu sehen, die anderen Felder sind denen im vorherigen Abschnitt ähnlich. Über dieses Feld lässt sich die Zuordnung der Aufgabe herstellen.

Fehlerbehandlung

Wenn beim Aufrufen der API ein Fehler auftritt, gibt die API den entsprechenden Fehlercode und die zugehörige Meldung zurück. Zum Beispiel:

  • 400 token_mismatched:Fehlerhafte Anfrage, möglicherweise aufgrund fehlender oder ungültiger Parameter.
  • 400 api_not_implemented:Fehlerhafte Anfrage, möglicherweise aufgrund fehlender oder ungültiger Parameter.
  • 401 invalid_token:Nicht autorisiert, ungültiges oder fehlendes Autorisierungstoken.
  • 429 too_many_requests:Zu viele Anfragen, Sie haben das Ratenlimit überschritten.
  • 500 api_error:Interner Serverfehler, auf dem Server ist ein Fehler aufgetreten.

Beispiel einer Fehlerantwort

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

Fazit

Anhand dieses Dokuments haben Sie erfahren, wie Sie mit der Producer Audios Generation API durch die Eingabe von Prompts Musik erzeugen können. Wir hoffen, dass Ihnen dieses Dokument dabei hilft, die API besser anzubinden und zu nutzen. Bei Fragen wenden Sie sich bitte jederzeit an unser technisches Supportteam.