Guida all'integrazione di Producer Audios Generation API

Questo documento presenta una guida all'integrazione di Producer Audios Generation API, che consente di generare musica ufficiale di Producer inserendo parametri personalizzati.

Procedura di richiesta

Per utilizzare Producer Audios Generation API, per prima cosa vai alla console di 零壹AI e ottieni il tuo API Token da utilizzare in seguito.

Se non hai ancora effettuato l'accesso o non sei registrato, verrai reindirizzato automaticamente alla pagina di accesso per registrarti e accedere; una volta completata la procedura, tornerai automaticamente alla pagina corrente.

L'API Key di un'applicazione generica può essere utilizzata per i servizi abilitati nell'account; la Key di un'applicazione dedicata va utilizzata nell'ambito dei servizi di tale applicazione. Controlla le autorizzazioni, la scadenza e i limiti della Key e verifica che il saldo dell'applicazione sia sufficiente a pagare questa richiesta. Il credito di prova disponibile è quello mostrato nell'account; se il saldo è insufficiente, fai clic sul pulsante «Ricarica».

📘 Documentazione completa: Producer Audios Generation API →

Selezione dei parametri obbligatori in base all'operazione

Quando action=generate e custom=false (impostazione predefinita), fornisci prompt; quando custom=true e instrumental=false, fornisci lyric. Per la musica strumentale personalizzata puoi impostare custom=true, instrumental=true, senza inventare testi o prompt aggiuntivi. Per action=extend sono necessari audio_id e un valore di continue_at maggiore di 0; in modalità non strumentale è necessario anche lyric. Per cover, varianti, sostituzione di sezioni, scambio delle parti e separazione delle tracce è sempre necessario l'audio_id della sorgente; testi e prompt non devono essere obbligatori incondizionatamente per tutte le operazioni.

In MCP, producer_extend_music e producer_replace_section, quando viene fornito lyric, selezionano la modalità con testo personalizzato; per la continuazione di musica strumentale puoi passare instrumental=true e omettere il testo.

Utilizzo di base

Per il tipo di brano che desideri, puoi inserire liberamente un testo; ad esempio, se vuoi generare una canzone sul Natale, puoi inserire a song for Christmas, come mostrato nell'immagine:

Qui puoi vedere che abbiamo impostato gli header della richiesta, tra cui:

  • accept:il formato della risposta che desideri ricevere; qui è impostato su application/json, cioè il formato JSON.
  • authorization:la chiave per chiamare l'API, che dopo la richiesta può essere selezionata direttamente dal menu a discesa.

Inoltre, i parametri del corpo della richiesta includono:

  • action:l'operazione del task di generazione musicale; per generare una canzone è generate.
  • model:il modello utilizzato per creare la canzone; attualmente i principali sono: 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:il testo della canzone.
  • custom:indica se generare la canzone in modalità personalizzata.
  • prompt:il prompt nella modalità ispirazione.
  • title:il titolo della canzone.
  • audio_id:l'ID della canzone di riferimento, utilizzato per operazioni come la continuazione o la cover.
  • continue_at:il secondo specificato da cui continuare la canzone.
  • replace_section_start/replace_section_end:gli istanti di inizio e fine della sezione da sostituire, in secondi.
  • lyrics_strength:l'intensità del testo, che indica il grado di influenza del testo sulla generazione dell'audio; valori da 0 a 1, con valore predefinito 0.5.
  • sound_strength:l'intensità del prompt audio; valori da 0.2 a 1, con valore predefinito 0.5.
  • cover_strength:l'intensità della cover; valori da 0.2 a 1, con valore predefinito 1.
  • weirdness:il grado di eccentricità dello stile; valori da 0 a 1, con valore predefinito 0.5
  • callback_url:l'URL a cui inviare il risultato tramite callback.
  • async:opzionale; se impostato su true, l'API restituisce immediatamente il task_id senza richiedere callback_url; successivamente si ottiene il risultato interrogando periodicamente la corrispondente API di consultazione dei task.
  • instrumental:indica se è attiva la modalità senza testo.

Dopo la selezione, puoi vedere che sulla destra viene generato anche il codice corrispondente, come mostrato nell'immagine:

Fai clic sul pulsante «Try» per eseguire il test; come mostrato nell'immagine sopra, qui abbiamo ottenuto il seguente risultato:

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

Il risultato restituito contiene diversi campi, descritti di seguito:

  • success,lo stato del task di generazione musicale.
    • data,il risultato del task musicale
      • id,l'ID del task di generazione musicale.
      • sound,il prompt del task di generazione musicale.
      • seed,il valore seed del task di generazione musicale.
      • audio_url,il link audio del task di generazione musicale.
      • image_url,il link alla copertina del task di generazione musicale.
      • image_id,l'ID della copertina del task di generazione musicale.
      • state,lo stato del task di generazione musicale.
      • duration,la durata del brano.
      • progress,il valore di avanzamento del task musicale.
      • model,le informazioni sul modello utilizzato per il task di generazione musicale.
      • lyric,le informazioni sul testo del task di generazione musicale.

Come puoi vedere, abbiamo ottenuto le informazioni sulla musica che volevamo generare; ci basta utilizzare il link audio in data per ottenere la musica di Producer generata.

Inoltre, se vuoi generare il codice di integrazione corrispondente, puoi copiarlo direttamente una volta generato; ad esempio, il codice CURL è il seguente:

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"
}'

Generazione personalizzata

Se vuoi generare un brano con un testo personalizzato, puoi inserire il testo: A questo punto, nel campo lyric si può inserire un contenuto simile al seguente:

[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

Successivamente, per generare una canzone personalizzata in base al testo, al titolo e allo stile, si possono specificare i seguenti contenuti:

  • lyric: il testo della canzone
  • custom: impostare su true, che indica la generazione personalizzata; il valore predefinito di questo parametro è false, che indica la generazione tramite prompt.
  • title: il titolo della canzone.

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, il codice viene generato automaticamente come segue:

Il codice corrispondente:

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
}'

È possibile effettuare un test; il risultato generato è simile.

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

Creare una cover di una canzone

Se si desidera creare una cover di una canzone già generata, è possibile inserire la canzone generata in precedenza per crearne una cover; successivamente genereremo una canzone personalizzata in base al testo e al titolo.

Se si desidera creare una cover di una canzone caricata dall'utente, è possibile impostare il parametro action su upload_cover e inserire l'ID della canzone caricata per la quale si desidera creare una cover; l'ID della canzone si ottiene tramite la Producer Upload API, come mostrato nella figura seguente:

Si possono quindi specificare i seguenti contenuti:

  • action: l'azione dell'attività relativa alla canzone; attualmente sono supportate: generate、cover、extend、upload_cover、upload_extend、replace_section、swap_vocals、swap_instrumentals、variation; per questa cover si usa il parametro cover.
  • lyric: il testo della canzone
  • title: il titolo della canzone.
  • custom: indica se generare in modalità personalizzata; il valore predefinito è false.
  • audio_id: l'ID della canzone di cui creare la cover.

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, il codice viene generato automaticamente come segue:

Il codice corrispondente:

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"
}'

Il test è consentito e il risultato generato è simile.

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

Estendere una canzone

Se si desidera estendere una canzone, è necessario passare il valore del parametro action come: extend; successivamente, si può generare una canzone personalizzata in base al testo, al titolo e allo stile.

Se si desidera continuare a estendere una canzone caricata personalmente, è possibile impostare il parametro action su upload_extend e inserire l'ID della canzone caricata che si desidera continuare a estendere. L'ID della canzone si ottiene utilizzando la Producer Upload API, come mostrato nella figura seguente:

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, viene generato automaticamente il codice seguente:

Il codice corrispondente:

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
}'

Il test è consentito e il risultato generato è simile.

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

Variazione musicale

Se si desidera generare un nuovo brano musicale con un effetto simile sulla base del valore seed del brano precedente, è necessario passare il valore del parametro action come: variation; successivamente, si può generare un nuovo brano musicale personalizzato con un effetto simile.

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, viene generato automaticamente il codice seguente:

Il codice corrispondente:

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
}'

Il test è consentito e il risultato generato è simile.

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

Sostituire una sezione

Se si desidera sostituire una sezione del brano, è necessario passare il parametro action con il valore replace_section; successivamente, bisogna generare un brano personalizzato in base al testo e al titolo.

Se si desidera continuare a sostituire una sezione di un brano caricato personalmente, si può impostare il parametro action su upload_replace_section e inserire l'ID del brano personalizzato caricato che si desidera continuare; l'ID del brano si ottiene utilizzando la Producer Upload API, come mostrato nell'immagine seguente:

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, il codice viene generato automaticamente come segue:

Il codice corrispondente:

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
}'

Il test è consentito e il risultato generato è simile.

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

Sostituzione dell'accompagnamento

Se si desidera utilizzare l'operazione ufficiale di sostituzione dell'accompagnamento, si può impostare il valore del parametro action su: swap_instrumentals; successivamente genereremo una canzone personalizzata in base al testo e al titolo.

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, viene generato automaticamente il seguente codice:

Il codice corrispondente:

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"
}'

Il test è consentito e il risultato generato è simile.

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

Sostituzione della voce

Se si desidera utilizzare l'operazione ufficiale di sostituzione della voce, si può impostare il valore del parametro action su: swap_vocals; successivamente genereremo una canzone personalizzata in base al testo, al titolo e allo stile.

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, viene generato automaticamente il seguente codice:

Il codice corrispondente:

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
}'

Il test è consentito e il risultato generato è simile.

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

Separazione della voce e della musica

Se si desidera utilizzare l’operazione ufficiale di separazione della voce e della musica, è possibile impostare il valore del parametro action su: stems. A questo punto eseguiremo la separazione in base all’ID della canzone.

Un esempio di compilazione è il seguente:

Una volta completata la compilazione, viene generato automaticamente il seguente codice:

Il codice corrispondente:

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"
}'

Eseguendo il test, il risultato generato è simile al seguente.

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

Callback asincrono

Poiché i tempi di generazione della Producer Audios Generation API possono talvolta essere relativamente lunghi, se l’API non risponde per molto tempo, la richiesta HTTP mantiene la connessione aperta, causando un consumo aggiuntivo di risorse di sistema; pertanto, questa API offre anche il supporto per i callback asincroni.

Il flusso complessivo è il seguente: quando il client invia una richiesta, specifica un ulteriore campo callback_url; dopo che il client ha inviato la richiesta API, l’API restituisce immediatamente un risultato contenente un campo task_id, che rappresenta l’ID dell’attività corrente. Al termine dell’attività, il risultato dell’attività di generazione viene inviato tramite POST JSON al callback_url specificato dal client, includendo anche il campo task_id, in modo che il risultato possa essere associato all’attività tramite l’ID.

Di seguito vedremo tramite un esempio come procedere nello specifico.

Innanzitutto, un callback Webhook è un servizio in grado di ricevere richieste HTTP; gli sviluppatori devono sostituirlo con l’URL del server HTTP che hanno configurato. Per comodità dimostrativa, qui utilizziamo un sito Webhook pubblico di esempio https://webhook.site/; aprendo il sito si ottiene un URL Webhook, come mostrato nella figura:

Copiando questo URL, è possibile utilizzarlo come Webhook; l’esempio qui riportato è https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1.

Successivamente, possiamo impostare il campo callback_url sull’URL Webhook sopra indicato e inserire i parametri corrispondenti; i dettagli sono mostrati nella figura:

Facendo clic su Esegui, si può osservare che viene immediatamente restituito un risultato, come segue:

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

Dopo una breve attesa, possiamo osservare il risultato dell’attività di generazione su https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1, come mostrato nella figura:

Il contenuto è il seguente:

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

Si può vedere che nel risultato è presente un campo task_id, mentre gli altri campi sono simili a quelli sopra; tramite questo campo è possibile associare l'attività.

Gestione degli errori

Quando si chiama l'API, se si verifica un errore, l'API restituisce il codice e il messaggio di errore corrispondenti. Ad esempio:

  • 400 token_mismatched:Richiesta non valida, probabilmente a causa di parametri mancanti o non validi.
  • 400 api_not_implemented:Richiesta non valida, probabilmente a causa di parametri mancanti o non validi.
  • 401 invalid_token:Non autorizzato, token di autorizzazione non valido o mancante.
  • 429 too_many_requests:Troppe richieste, hai superato il limite di frequenza.
  • 500 api_error:Errore interno del server, si è verificato un problema sul server.

Esempio di risposta di errore

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

Conclusione

Attraverso questo documento, hai appreso come utilizzare la Producer Audios Generation API per generare musica inserendo parole di prompt. Ci auguriamo che questo documento possa aiutarti a integrare e utilizzare meglio questa API. Per qualsiasi domanda, non esitare a contattare il nostro team di supporto tecnico.