请求示例
curl --request POST \
--url https://api.openveer.com/v1/music/generations/extendFlowMusic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"clip_id": "abc123-def456",
"extend_from_s": 30,
"extend_s": 60,
"instruction": "延续主歌旋律,加入弦乐"
}'import requests
url = "https://api.openveer.com/v1/music/generations/extendFlowMusic"
payload = {
"model": "flowmusic",
"clip_id": "abc123-def456",
"extend_from_s": 30,
"extend_s": 60,
"instruction": "延续主歌旋律,加入弦乐"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const url = "https://api.openveer.com/v1/music/generations/extendFlowMusic";
const payload = {
model: "flowmusic",
clip_id: "abc123-def456",
extend_from_s: 30,
extend_s: 60,
instruction: "延续主歌旋律,加入弦乐"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));响应示例
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KWXVCYB70YJ1WY9X22RVYRNP"
}
]
}{
"error": {
"message": "clip_id is required",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}{
"error": {
"message": "余额不足",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}{
"error": {
"message": "当前分组容量饱和,请稍后重试",
"type": "rate_limit_error",
"param": "",
"code": "rate_limit_error"
}
}认证
Authorization string所有接口均需要使用 Bearer Token 进行认证
获取 API Key:
访问 API Key 管理页面 获取您的 API Key
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY请求参数
model string模型名称,固定传 "flowmusic"(大小写不敏感)
clip_id string源音乐 clip_id,来自已成功任务的 result.music[].clip_id
注意
源任务必须已成功。外部音频可先通过上传音频导入换取 clip_id。
extend_from_s number开始续写的时间点(秒)
不能超过源 clip 时长
extend_s number续写时长(秒)
最大值:164 秒
instruction string续写音乐的编辑指令
示例:"延续主歌旋律,加入弦乐"
title string续写后音乐标题
seed string随机种子,用于复现结果
响应
code integer响应状态码,成功时为 200
data array返回数据数组
status string任务状态,初始提交时为 submitted
task_id string任务唯一标识符,用于查询任务状态和结果
使用场景
场景 1:从副歌处续写 60 秒
{
"model": "flowmusic",
"clip_id": "abc123-def456",
"extend_from_s": 30,
"extend_s": 60,
"instruction": "延续主歌旋律,加入弦乐"
}注意
查询任务结果
音乐延伸为异步任务,提交后会返回 task_id。使用 获取任务状态 接口查询生成进度和结果。延伸产物是新的 clip_id,后续操作请使用新 clip_id。
任务完成结果示例
查询返回示例(GET /v1/music/tasks/{task_id}):
{
"code": 200,
"data": {
"id": "task_01KWXVCYB70YJ1WY9X22RVYRNP",
"status": "completed",
"progress": 100,
"created": 1783413242,
"completed": 1783413292,
"actual_time": 50,
"cost": 0.048,
"credits_cost": 0.48,
"result": {
"music": [
{
"clip_id": "d2f589ea-5390-4e83-8e2f-4517420408fa",
"title": "Untitled (Extended)",
"duration_seconds": "39.95733333",
"create_time": "2026-07-07T08:34:33.240020Z",
"lyrics": "waking up to the morning light,\n...",
"lyrics_id": "0452451b-9e54-5d9f-8437-8bff97c7bbc8",
"lyrics_timing_markers": [[0, 12], [129, 20]],
"audio_url": "https://cdn.openveer.com/audio/flowmusic_d2f589ea.m4a",
"wav_url": "https://cdn.openveer.com/audio/flowmusic_d2f589ea.wav",
"image_url": "https://cdn.openveer.com/image/flowmusic_d2f589ea_cover.jpg"
}
]
}
}
}