Pular para o conteúdo
Referência de API
Referência de API

Suno Adicionar vocais

Use o endpoint add vocals para criar uma Task assíncrona.

01

Visão geral

Use o endpoint add vocals com um modelo compatível. Utilize o ID da Task retornado para recuperar seu estado, ou forneça callback_url para as entregas documentadas abaixo.

Início rápido

  1. Crie uma Chave de API e defina-a como RUNAPI_API_KEY.
  2. Escolha um modelo compatível e envie uma requisição POST cujo corpo corresponda ao schema desse modelo.
  3. Armazene o ID da tarefa retornado e, em seguida, faça polling até atingir um estado terminal ou trate os callbacks documentados abaixo.

Endpoint

POST /api/v1/suno/add_vocals
URL base
https://runapi.ai
Versão da API
v1
Autenticação
Authorization: Bearer YOUR_API_TOKEN
02

Modelos suportados

Abra uma página de modelo para ver preços atuais, limites de taxa e detalhes de uso comercial.

03

Esquema de solicitação

Corpo JSON

Os campos e valores permitidos dependem do modelo selecionado. Quando fornecido, callback_url recebe as entregas da Task documentadas abaixo.

suno-v4.5-plus11 campos
audio_weightnumber
Opcional

Peso do áudio (0-1).

Intervalo: 0 - 1
callback_urlstring
Opcional

URL de webhook para notificações assíncronas.

lyricsstring
Obrigatório

Letra vocal a ser cantada.

Limite: 5000
modelstring
Obrigatório

Slug do modelo.

negative_tagsstring
Obrigatório

Estilos a evitar.

stylestring
Obrigatório

Predefinição de estilo.

Limite: 1000
style_weightnumber
Opcional

Peso de aderência ao estilo (0-1).

Intervalo: 0 - 1
titlestring
Obrigatório

Título da música.

Limite: 80
upload_urlstring
Obrigatório

URL do arquivo de áudio ao qual adicionar vocais.

vocal_genderstring
Opcional

Gênero vocal.

Valores permitidos: male, female
weirdness_constraintnumber
Opcional

Restrição de estranheza (0-1).

Intervalo: 0 - 1
suno-v511 campos
audio_weightnumber
Opcional

Peso do áudio (0-1).

Intervalo: 0 - 1
callback_urlstring
Opcional

URL de webhook para notificações assíncronas.

lyricsstring
Obrigatório

Letra vocal a ser cantada.

Limite: 5000
modelstring
Obrigatório

Slug do modelo.

negative_tagsstring
Obrigatório

Estilos a evitar.

stylestring
Obrigatório

Predefinição de estilo.

Limite: 1000
style_weightnumber
Opcional

Peso de aderência ao estilo (0-1).

Intervalo: 0 - 1
titlestring
Obrigatório

Título da música.

Limite: 80
upload_urlstring
Obrigatório

URL do arquivo de áudio ao qual adicionar vocais.

vocal_genderstring
Opcional

Gênero vocal.

Valores permitidos: male, female
weirdness_constraintnumber
Opcional

Restrição de estranheza (0-1).

Intervalo: 0 - 1
04

Criar aceitação

HTTP 202

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
05

Consulta em processamento

HTTP 200

GET /api/v1/suno/add_vocals/:id

Esquema de resposta
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "generation_stage": "text_generated",
  "id": "tsk_reference_demo",
  "status": "processing"
}
06

Consulta concluída

HTTP 200

GET /api/v1/suno/add_vocals/:id

Esquema de resposta
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready",
        "all_audios_ready",
        "failed"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "audios": [
    {
      "audio_url": "https://file.runapi.ai/reference-audio.mp3",
      "id": "audio_reference"
    }
  ],
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed"
}
07

Consulta falhou

HTTP 200

GET /api/v1/suno/add_vocals/:id

Esquema de resposta
JSON
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
08

Callback do cliente: processando

HTTP 200

POST callback_url

Esquema de resposta
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "generation_stage": "text_generated",
  "id": "tsk_reference_demo",
  "status": "processing"
}
09

Callback do cliente: concluído

HTTP 200

POST callback_url

Esquema de resposta
JSON
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "duration": {
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "lyrics": {
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "stream_audio_url": {
            "type": "string",
            "x-runapi-generated-media": true
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "generation_stage": {
      "enum": [
        "text_generated",
        "first_audio_ready",
        "all_audios_ready",
        "failed"
      ],
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "audios": [
    {
      "audio_url": "https://file.runapi.ai/reference-audio.mp3",
      "id": "audio_reference"
    }
  ],
  "id": "tsk_reference_demo",
  "status": "completed"
}
10

Callback do cliente: falhou

HTTP 200

POST callback_url

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
11

Erros

HTTP 401

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "Authentication required"
}
12

Erros

HTTP 401

GET /api/v1/suno/add_vocals/:id

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "Authentication required"
}
13

Erros

HTTP 400

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Mensagem de erro legível por humanos.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Resumo de validação legível por humanos.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Mensagens de validação com chaves por campo de requisição público, com um array de strings legíveis por humanos para cada campo.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

Exemplo de resposta

JSON
{
  "error": "model must be one of: suno-v4.5-plus, suno-v5"
}
14

Erros

HTTP 402

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "Insufficient balance"
}
15

Erros

HTTP 429

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "API key credit limit exceeded"
}
16

Erros

HTTP 409

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "The request uses features that are not supported for the selected model"
}
17

Erros

HTTP 429

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "Rate limit reached. Please retry later."
}
18

Erros

HTTP 503

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "Service under maintenance, please try again later"
}
19

Erros

HTTP 504

POST /api/v1/suno/add_vocals

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "The request timed out"
}
20

Erros

HTTP 404

GET /api/v1/suno/add_vocals/:id

Esquema de resposta
JSON
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Exemplo de resposta

JSON
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
21

Exemplos de Código Gerados

Use cURL diretamente ou instale um SDK para a sua linguagem. Cada exemplo submete a requisição validada mostrada nesta referência.

Instalar

Shell
pip install runapi-suno
PYTHON
import os
from runapi.suno import SunoClient

client = SunoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.add_vocals.create(
  model="suno-v5",
  upload_url="https://file.runapi.ai/source-instrumental.mp3",
  lyrics="City lights reflect in the rain.",
  title="City Lights",
  style="acoustic pop",
  negative_tags="heavy metal"
)