da Suno

músicas com voz

suno/v6/audio-inpaint
Suno v6: gerador de música com IA online
  • Suas próprias letras
  • Música
  • Separador de faixas
  • Estúdio de músicas
  • Estúdio de músicas
  • Estúdio de músicas

Chame com o nome de modelo suno/v6/audio-inpaint em POST /jobs/createTask, a partir de US$ 0,03.

Nome do modelosuno/v6/audio-inpaint
EndpointPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "suno/v6/audio-inpaint",
  "input": {
    "prompt": "Calm ambient pads with a slow rising motif",
    "audio_url": "https://media.popnow.ai/shortfilm/voices/Aoede-46e4c427.mp3",
    "start_seconds": 0,
    "end_seconds": 0,
    "lyrics": "[Verse]\nMorning light on the window\nCoffee warm in my hands",
    "full_lyrics": "[Verse]\nMorning light on the window\nCoffee warm in my hands"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

O input é montado a partir do schema abaixo, então passa na validação como está. Troque o prompt e os links pelos seus.

Preço

OpçãoUSD por geração
PadrãoUS$ 0,03

Cobrança em USD · Todas as opções e preços: GET /models/suno/v6/audio-inpaint

Limites

Tamanho do prompt (caracteres)
1,000

Parâmetros

Estes campos vêm do mesmo schema que usamos para validar cada requisição. Campos que não estão na lista são rejeitados.

  • audio_urlstringObrigatório

    A voz ou a música a usar.

    Faixa
    Número de caracteres: ≥ 1 · audio/mpeg, audio/wav, audio/mp4, audio/aac +3
  • start_secondsnumberObrigatório

    Início do trecho a substituir, em segundos desde o começo da música.

    Faixa
    0 – …
  • end_secondsnumberObrigatório

    Fim do trecho a substituir. Selecione pelo menos 10 segundos e no máximo metade da música.

    Faixa
    0 – …
  • lyricsstringObrigatório

    Escreva sua própria letra ou deixe o modelo escrever.

    Faixa
    Número de caracteres: 1 – 5000
  • full_lyricsstringObrigatório

    Letra de toda a música com o novo trecho incluído.

    Faixa
    Número de caracteres: 1 – 5000
  • promptstringObrigatório

    Descreva o que você quer criar.

    Faixa
    Número de caracteres: 1 – 1000
  • titlestringOpcional

    Nome da música. Não é cantado.

    Padrão
    "Untitled"
    Faixa
    Número de caracteres: 1 – 100
  • negative_promptstringOpcional

    Estilos ou sons que você não quer na faixa.

    Faixa
    Número de caracteres: 1 – 500
  • vocal_genderstringOpcional

    Deixa mais provável um vocal principal mais agudo ou mais grave.

    Valores aceitos
    "female""male"
  • style_weightnumberOpcional

    O quanto seguir o estilo do seu prompt.

    Faixa
    0 – 1 · Incremento: 0.01
  • weirdnessnumberOpcional

    O quanto a música pode ser experimental.

    Faixa
    0 – 1 · Incremento: 0.01
  • audio_weightnumberOpcional

    O quanto a voz da persona molda a música.

    Faixa
    0 – 1 · Incremento: 0.01
  • varietyintegerOpcional

    O quanto as duas versões diferem entre si.

    Faixa
    0 – 4
  • persona_idstringOpcional

    ID de uma persona salva cujo estilo ou voz você quer reaproveitar.

    Faixa
    Número de caracteres: 1 – 200
  • persona_modelstringOpcional

    Se essa persona é um estilo ou uma voz.

    Valores aceitos
    "style_persona""voice_persona"
JSON Schema original
{
  "additionalProperties": false,
  "properties": {
    "audio_url": {
      "contentMediaType": [
        "audio/mpeg",
        "audio/wav",
        "audio/mp4",
        "audio/aac",
        "audio/ogg",
        "audio/opus",
        "audio/flac"
      ],
      "minLength": 1,
      "type": "string"
    },
    "audio_weight": {
      "description": "How much the source recording weighs against the style in prompt, from 0 to 1.",
      "maximum": 1,
      "minimum": 0,
      "multipleOf": 0.01,
      "type": "number"
    },
    "end_seconds": {
      "description": "End of the section to replace, in seconds: at least 10 seconds after start_seconds, and the section may cover at most half the song.",
      "minimum": 0,
      "type": "number"
    },
    "full_lyrics": {
      "description": "The whole song's lyrics after the change: the new section in place, the other sections as they were.",
      "maxLength": 5000,
      "minLength": 1,
      "type": "string"
    },
    "lyrics": {
      "description": "Words the replaced section should sing.",
      "maxLength": 5000,
      "minLength": 1,
      "type": "string"
    },
    "negative_prompt": {
      "description": "Styles or elements to keep out of the result.",
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "persona_id": {
      "description": "ID of an existing Suno persona to reuse its style or voice.",
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "persona_model": {
      "description": "Whether persona_id is a style persona or a voice persona.",
      "enum": [
        "style_persona",
        "voice_persona"
      ],
      "type": "string"
    },
    "prompt": {
      "description": "The song's style: genre, mood, instruments and voice. Repeat the original style so the section blends in.",
      "maxLength": 1000,
      "minLength": 1,
      "type": "string"
    },
    "start_seconds": {
      "description": "Start of the section to replace, in seconds.",
      "minimum": 0,
      "type": "number"
    },
    "style_weight": {
      "description": "How closely to follow the style in prompt, from 0 to 1.",
      "maximum": 1,
      "minimum": 0,
      "multipleOf": 0.01,
      "type": "number"
    },
    "title": {
      "default": "Untitled",
      "description": "Title for the edited song (metadata, not sung).",
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "variety": {
      "description": "How different the two versions are from each other: 0 off, 1 normal (the default), 2 high, 3 extra, 4 max.",
      "maximum": 4,
      "minimum": 0,
      "type": "integer"
    },
    "vocal_gender": {
      "description": "Make a female or male lead vocal more likely.",
      "enum": [
        "female",
        "male"
      ],
      "type": "string"
    },
    "weirdness": {
      "description": "How experimental the result may get, from 0 (conventional) to 1 (unusual).",
      "maximum": 1,
      "minimum": 0,
      "multipleOf": 0.01,
      "type": "number"
    }
  },
  "required": [
    "audio_url",
    "start_seconds",
    "end_seconds",
    "lyrics",
    "full_lyrics",
    "prompt"
  ],
  "type": "object"
}

Respostas, consultas e callbacks

Todos os modelos funcionam do mesmo jeito: crie uma tarefa e depois consulte ou espere o callback.

Veja o preço antes

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "suno/v6/audio-inpaint",
  "input": {
    "prompt": "Calm ambient pads with a slow rising motif",
    "audio_url": "https://media.popnow.ai/shortfilm/voices/Aoede-46e4c427.mp3",
    "start_seconds": 0,
    "end_seconds": 0,
    "lyrics": "[Verse]\nMorning light on the window\nCoffee warm in my hands",
    "full_lyrics": "[Verse]\nMorning light on the window\nCoffee warm in my hands"
  }
}'

Antes de executar, envie o mesmo corpo de requisição para POST /jobs/quote para ver o custo estimado e o máximo em USD. A cotação não executa tarefas nem debita seu saldo.

Aceita

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 significa que a tarefa foi aceita: o máximo em USD fica reservado até o acerto final. Ao aceitar uma tarefa, reservamos o valor máximo da cotação no seu saldo da PopNow. Ao concluir, cobramos o uso real sem ultrapassar a reserva e liberamos o restante. Se a tarefa falhar, o valor reservado é liberado.

Consultar status

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Consulte a cada poucos segundos, espaçando cada vez mais, e pare quando state for succeeded, failed, canceled ou expired.

Tarefa pronta

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "suno/v6/audio-inpaint",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.mp3?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "audio/mpeg",
          "durationSeconds": 30
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Baixe pela url antes de expiresAt. Precisa de um link novo depois? Peça com POST /common/download-url.

Verificar um callback

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

Com callBackUrl definida, enviamos a tarefa pronta para você. Confira a assinatura no corpo bruto antes de confiar nela.

Enviar um arquivo local

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

Links https públicos funcionam como estão. Arquivos locais passam antes por upload-url e commit.