获取 API Key 获取 API
文档

风格翻唱

- 以另一种风格翻唱已有歌曲。

  • 引用源音轨:task_id + audio_index 指定,无需记录任何额外 id
  • 异步任务:提交返回 task_id,轮询 GET /v1/music/tasks/:task_id 获取结果
信息

引用源音轨:基于已有歌曲的操作无需记任何额外 id,只需传 task_id(产出源音轨那次任务的 task_id)+ audio_index(结果 music[] 里第几首,1-based,默认 1)。

警告

custom 决定字段是否生效:写了但模式不对的字段会被静默忽略(不报错)。custom=true 时 prompt(歌词)、title、tags、negative_tags、style_weight、weirdness_constraint、audio_weight、persona_id 生效,gpt_description 被忽略;custom=false 时只认 gpt_description(此时必填,缺了提交期直接 400)。vocal_gender 两种模式都生效。不传 custom 时后端按此顺序推断:有 prompt → true;无 prompt 但有 gpt_description → false;否则有 tags/title → true。

用法

用法 A —— 指定风格翻唱(最常用,推荐)

给源歌曲 + 目标风格 tags,不用管 custom(系统看到 tags 会自动按 custom=true 处理):

{
  "model": "suno",
  "task_id": "task_xxx",   // 源歌曲:一个已完成的音乐任务
  "audio_index": 1,         // 源任务里第几首(1-based,默认 1)
  "version": "v5",
  "tags": "jazz, slow"      // 目标风格 → 自动 custom=true
}

想更精确可以再加 prompt(歌词)/ title。

用法 B —— 灵感模式(custom=false)

不指定具体风格,让模型自己发挥,但必须给 gpt_description 描述你想要的效果:

{
  "model": "suno",
  "task_id": "task_xxx",
  "audio_index": 1,
  "version": "v5",
  "custom": false,
  "gpt_description": "把这首歌翻唱成慢速爵士风格"   // custom=false 时必填
}

两种用法二选一,别只传 custom=false 却不给 gpt_description(会提交期直接 400)。

请求示例

curl -X POST https://api.openveer.com/v1/music/generations/coverSong \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "suno",
    "task_id": "task_01ABC",
    "audio_index": 1,
    "version": "v5",
    "tags": "jazz, slow"
  }'

响应示例

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}

Authorizations

Authorization string

所有接口均需要使用Bearer Token进行认证

获取 API Key:

访问 API Key 管理页面 获取您的 API Key

使用时在请求头中添加:

Authorization: Bearer YOUR_API_KEY

Body

model string

音频模型。当前传 suno(不传默认 suno)。

task_id string

产出源音轨那次任务的 task_id;缺失或无法解析源时提交期直接返回 400。

audio_index integer

引用源任务结果 data.music[] 中的第几首(1-based:1=第 1 首;默认 1;一次生成通常 2 首:索引 1 与 2)。

version string

生成版本:v3.5 / v4 / v4.5 / v4.5+ / v4.5-all / v5 / v5.5,影响音质与计费;不传默认 v5.5,非法值提交期直接返回 400。

custom boolean

true=自定义模式(用 prompt 作歌词);false=灵感模式(用 gpt_description);不传时按内容推断(见上方 Warning)。

prompt string

歌词,custom=true 时生效(灵感模式下会被忽略)。

gpt_description string

灵感提示词,custom=false 时必填(缺了提交期直接 400、不扣费)。

title string

标题。仅 custom=true 时生效。

tags string

目标风格标签。仅 custom=true 时生效。

negative_tags string

排除的风格标签。仅 custom=true 时生效。

style_weight number

风格权重,0.00–1.00(超出范围提交期直接返回 400)。仅 custom=true 时生效。

weirdness_constraint number

创意度权重,0.00–1.00(别名 weirdness)。仅 custom=true 时生效。

audio_weight number

音频权重,0.00–1.00。仅 custom=true 时生效。

vocal_gender string

人声性别:Male / Female。两种模式均生效。

persona_id string

Persona 风格 id。仅 custom=true 时生效。

注意

获取结果:本接口为异步任务。提交后拿到 task_id,按 3–5s 间隔轮询 GET /v1/music/tasks/{task_id},直到 status 为 completed 或 failed(音乐生成通常 30–120s;生成中为 pending,progress 排队 10 → 就绪 50 → 完成 100)。完成后在 data.result.music[] 取 audio_url。失败时 data.error.message 为原因,自动退回预扣额度。

Response

code integer

响应状态码

data array
返回数据数组
status string

任务状态

  * submitted - 已提交
task_id string

任务唯一标识符(用于轮询 GET /v1/music/tasks/{task_id} 获取结果)