Guia de integração da API Producer Audios Generation

Este artigo apresenta um guia de integração da API Producer Audios Generation, que permite gerar músicas oficiais do Producer por meio da entrada de parâmetros personalizados.

Processo de solicitação

Para usar a API Producer Audios Generation, primeiro acesse o console da AI 聚合 e obtenha seu API Token para uso posterior.

Se você ainda não tiver feito login ou se registrado, será redirecionado automaticamente para a página de login, onde poderá se registrar e entrar. Após a conclusão, você retornará automaticamente à página atual.

A API Key de uma aplicação geral pode ser usada nos serviços habilitados para a conta; a Key de uma aplicação dedicada deve ser usada de acordo com o escopo de serviços dessa aplicação. Verifique as permissões, a validade e os limites da Key e confirme se o saldo da aplicação é suficiente para pagar por esta solicitação. As cotas de avaliação disponíveis são aquelas exibidas na conta; se o saldo for insuficiente, clique no botão «Recarregar».

📘 Documentação completa: API Producer Audios Generation →

Selecione os parâmetros obrigatórios conforme a operação

Quando action=generate e custom=false (padrão), forneça prompt; quando custom=true e instrumental=false, forneça lyric. Para música instrumental personalizada, é possível definir custom=true, instrumental=true, sem necessidade de inventar letras ou prompts adicionais. action=extend exige audio_id e um continue_at maior que 0; em modo não instrumental, também é necessário lyric. Covers, variantes, substituição de trechos, troca de vozes e separação de faixas exigem o audio_id de origem; letras e prompts não devem ser obrigatórios incondicionalmente para todas as operações.

No MCP, producer_extend_music e producer_replace_section selecionam o modo de letra personalizada quando lyric é fornecido; para continuar música instrumental, é possível passar instrumental=true e omitir a letra.

Uso básico

Você pode inserir qualquer trecho de texto sobre a música desejada. Por exemplo, se eu quiser gerar uma música sobre o Natal, posso inserir a song for Christmas, conforme mostrado na imagem:

Podemos ver que aqui configuramos os cabeçalhos da requisição, incluindo:

  • accept: o formato em que se deseja receber a resposta; aqui é preenchido com application/json, ou seja, o formato JSON.
  • authorization: a chave para chamar a API, que pode ser selecionada diretamente na lista suspensa após a solicitação.

Além disso, os parâmetros do corpo da requisição incluem:

  • action: a ação desta tarefa de geração de música; para gerar uma música, é generate.
  • model: o modelo usado para criar a música; atualmente, os principais são: 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: o conteúdo da letra da música.
  • custom: se a música deve ser gerada de forma personalizada.
  • prompt: o prompt no modo de inspiração.
  • title: as informações do título da música.
  • audio_id: o ID da música de referência, usado em operações como continuação e cover.
  • continue_at: continua a música a partir do segundo especificado.
  • replace_section_start/replace_section_end: os tempos de início e fim do trecho a ser substituído, em segundos.
  • lyrics_strength: a intensidade da letra, que indica seu grau de influência na geração do áudio; pode variar de 0 a 1, com padrão de 0,5.
  • sound_strength: a intensidade do prompt de áudio; pode variar de 0,2 a 1, com padrão de 0,5.
  • cover_strength: a intensidade do cover, entre 0,2 e 1, com padrão de 1.
  • weirdness: o grau de excentricidade do estilo; pode variar de 0 a 1, com padrão de 0,5.
  • callback_url: a URL para receber o resultado via callback.
  • async: opcional; quando definido como true, a interface retorna imediatamente um task_id, sem necessidade de fornecer callback_url, e o resultado pode ser obtido posteriormente por consultas periódicas à interface de consulta de tarefas correspondente.
  • instrumental: se o modo é sem letra.

Após a seleção, podemos ver que o código correspondente também foi gerado à direita, conforme mostrado na imagem:

Clique no botão «Try» para realizar o teste. Conforme mostrado na imagem acima, obtivemos o seguinte resultado:

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

O resultado retornado possui vários campos, descritos a seguir:

  • success, o estado da tarefa de geração de música neste momento.
    • data, o resultado desta tarefa de música.
      • id, o ID da tarefa de geração de música neste momento.
      • sound, o prompt da tarefa de geração de música neste momento.
      • seed, o valor da semente da tarefa de geração de música neste momento.
      • audio_url, o link de áudio da tarefa de geração de música neste momento.
      • image_url, o link da capa da tarefa de geração de música neste momento.
      • image_id, o ID da capa da tarefa de geração de música neste momento.
      • state, o estado da tarefa de geração de música neste momento.
      • duration, as informações de duração da música neste momento.
      • progress, o valor do progresso da tarefa de música neste momento.
      • model, as informações do modelo usado na tarefa de geração de música neste momento.
      • lyric, as informações da letra da tarefa de geração de música neste momento.

Podemos ver que obtivemos as informações da música que queríamos gerar; basta acessar o endereço do link de música em data no resultado para obter a música gerada pelo Producer.

Além disso, se quiser gerar o código de integração correspondente, basta copiar o código gerado. Por exemplo, o código CURL é o seguinte:

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

Geração personalizada

Se quiser gerar uma música com letra personalizada, você pode inserir a letra: Neste momento, o campo lyric pode receber um conteúdo semelhante ao seguinte:

[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

Em seguida, para gerar uma música personalizada com base na letra, no título e no estilo, podemos especificar o seguinte:

  • lyric: texto da letra
  • custom: preencher com true, indicando geração personalizada; o valor padrão desse parâmetro é false, indicando a geração usando prompt.
  • title: título da música.

Exemplo de preenchimento:

Após o preenchimento, o código foi gerado automaticamente da seguinte forma:

Código correspondente:

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

O teste foi permitido, e o resultado gerado é semelhante.

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

Fazer um cover de uma música

Se quiser fazer um cover de uma música já gerada, você pode inserir a música gerada acima para fazer o cover; em seguida, vamos gerar uma música personalizada com base na letra e no título.

Se quiser fazer um cover de uma música enviada por você, defina o parâmetro action como upload_cover e insira o ID da música enviada para a qual deseja fazer o cover. O ID da música é obtido usando a Producer Upload API, como mostrado na imagem abaixo:

Então, você pode especificar o seguinte:

  • action: ação da tarefa de música; atualmente são suportadas: generate, cover, extend, upload_cover, upload_extend, replace_section, swap_vocals, swap_instrumentals, variation. Para este cover, use o parâmetro cover.
  • lyric: texto da letra
  • title: título da música.
  • custom: se a geração usará o modo personalizado; o padrão é false.
  • audio_id: ID da música da qual será feito o cover.

Exemplo de preenchimento:

Após o preenchimento, o código foi gerado automaticamente da seguinte forma:

Código correspondente:

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

O teste é permitido, e o resultado gerado é semelhante.

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

Continuar uma música

Se quisermos continuar uma música, precisamos passar o valor do parâmetro action como: extend; em seguida, podemos gerar uma música personalizada com base na letra, no título e no estilo.

Se quisermos continuar uma música enviada por nós mesmos, podemos definir o parâmetro action como upload_extend e inserir o ID da música enviada que desejamos continuar. O ID da música é obtido usando a Producer Upload API, conforme mostrado na imagem abaixo:

Um exemplo de preenchimento é mostrado abaixo:

Após o preenchimento, o código é gerado automaticamente, conforme mostrado abaixo:

Código correspondente:

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

O teste é permitido, e o resultado gerado é semelhante.

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

Variação de música

Se quisermos gerar uma nova música com um resultado semelhante com base no valor de seed da música anterior, precisamos passar o valor do parâmetro action como: variation; em seguida, podemos gerar uma nova música personalizada com um resultado semelhante.

Um exemplo de preenchimento é mostrado abaixo:

Após o preenchimento, o código é gerado automaticamente, conforme mostrado abaixo:

Código correspondente:

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

O teste é permitido, e o efeito gerado é semelhante.

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

Substituir trecho

Se quisermos substituir um trecho da música, precisamos definir o valor do parâmetro action como replace_section. Em seguida, precisamos gerar a música de forma personalizada com base na letra e no título.

Se quisermos continuar substituindo trechos de uma música que enviamos, podemos definir o parâmetro action como upload_replace_section e inserir o ID da música enviada de forma personalizada que precisa ser continuada. O ID da música é obtido usando a Producer Upload API, como mostrado na imagem abaixo:

Um exemplo de preenchimento é mostrado abaixo:

Após o preenchimento, o código abaixo foi gerado automaticamente:

O código correspondente:

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

O teste é permitido, e o efeito gerado é semelhante.

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

Versão de acompanhamento

Se quiser usar a operação oficial de versão de acompanhamento, você pode definir o valor do parâmetro action como: swap_instrumentals. Em seguida, vamos gerar uma música personalizada com base na letra e no título.

O exemplo de preenchimento é o seguinte:

Após o preenchimento, o código foi gerado automaticamente da seguinte forma:

O código correspondente:

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

O teste é permitido, e o resultado gerado é semelhante.

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

Versão vocal

Se quiser usar a operação oficial de versão vocal, você pode definir o valor do parâmetro action como: swap_vocals. Em seguida, vamos gerar uma música personalizada com base na letra, no título e no estilo.

O exemplo de preenchimento é o seguinte:

Após o preenchimento, o código foi gerado automaticamente da seguinte forma:

O código correspondente:

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

O teste é permitido, e o resultado gerado é semelhante.

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

Separação de vocais e instrumental

Se quiser usar a operação oficial de separação de vocais e instrumental, você pode definir o valor do parâmetro action como stems. Em seguida, faremos a separação de vocais e instrumental com base no ID da música.

Um exemplo de preenchimento é mostrado abaixo:

Após o preenchimento, o código gerado automaticamente é o seguinte:

O código correspondente:

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

O teste foi executado, e o resultado gerado é semelhante.

{
    "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 assíncrono

Como o tempo de geração da API Producer Audios Generation às vezes pode ser relativamente longo, se a API não responder por muito tempo, a solicitação HTTP permanecerá conectada, causando consumo adicional de recursos do sistema. Por isso, esta API também oferece suporte a callbacks assíncronos.

O fluxo geral é o seguinte: quando o cliente inicia uma solicitação, ele especifica adicionalmente um campo callback_url. Após o cliente iniciar a solicitação à API, ela retorna imediatamente um resultado contendo um campo task_id, que representa o ID da tarefa atual. Quando a tarefa for concluída, o resultado da tarefa de geração será enviado ao callback_url especificado pelo cliente na forma de um POST JSON, incluindo também o campo task_id, para que o resultado da tarefa possa ser associado pelo ID.

A seguir, vamos usar um exemplo para entender como realizar a operação.

Primeiro, o callback do Webhook é um serviço capaz de receber solicitações HTTP, e o desenvolvedor deve substituí-lo pela URL de seu próprio servidor HTTP. Para facilitar a demonstração, usaremos um site público de exemplo de Webhook, https://webhook.site/. Ao abrir o site, você receberá uma URL de Webhook, conforme mostrado na imagem:

Copie essa URL e ela poderá ser usada como Webhook. O exemplo aqui é https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1.

Em seguida, podemos definir o campo callback_url como a URL do Webhook acima e preencher os parâmetros correspondentes. O conteúdo específico é mostrado na imagem:

Clique em executar e você verá que um resultado será retornado imediatamente, conforme abaixo:

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

Após aguardar um momento, podemos observar o resultado da tarefa de geração em https://webhook.site/#!/view/0d73431d-f833-4be4-9276-b6e1690d55c1, conforme mostrado na imagem:

O conteúdo é o seguinte:

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

É possível ver que o resultado contém um campo task_id, enquanto os demais campos são semelhantes aos apresentados anteriormente; esse campo permite associar as tarefas.

Tratamento de erros

Ao chamar a API, se ocorrer um erro, a API retornará o código e a mensagem de erro correspondentes. Por exemplo:

  • 400 token_mismatched:Solicitação inválida, possivelmente devido a parâmetros ausentes ou inválidos.
  • 400 api_not_implemented:Solicitação inválida, possivelmente devido a parâmetros ausentes ou inválidos.
  • 401 invalid_token:Não autorizado, token de autorização inválido ou ausente.
  • 429 too_many_requests:Muitas solicitações, você excedeu o limite de requisições.
  • 500 api_error:Erro interno do servidor, algo deu errado no servidor.

Exemplo de resposta de erro

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

Conclusão

Por meio deste documento, você aprendeu como usar a API Producer Audios Generation para gerar músicas a partir de prompts. Esperamos que este documento ajude você a integrar e usar melhor essa API. Se tiver alguma dúvida, entre em contato com nossa equipe de suporte técnico.