Request example
curl --request POST \
--url https://api.openveer.com/v1/music/generations/replaceFlowMusic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "Replace with a piano version"
}'import requests
url = "https://api.openveer.com/v1/music/generations/replaceFlowMusic"
payload = {
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "Replace with a piano version"
}
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/replaceFlowMusic";
const payload = {
model: "flowmusic",
clip_id: "abc123-def456",
start_s: 10,
end_s: 20,
instruction: "Replace with a piano version"
};
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));Response example
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KWXVHGTG5JM33S8FG1K90YQ6"
}
]
}{
"error": {
"message": "end_s must be greater than start_s",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}{
"error": {
"message": "Insufficient balance",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}{
"error": {
"message": "Current group capacity is saturated, please retry later",
"type": "rate_limit_error",
"param": "",
"code": "rate_limit_error"
}
}Authentication
Authorization stringAll endpoints require Bearer Token authentication
Get your API Key:
Visit the API Key management page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEYRequest Parameters
model stringModel name, must be "flowmusic" (case-insensitive)
clip_id stringSource music clip_id, from a successful task's result.music[].clip_id
start_s numberReplacement start time (seconds)
end_s numberReplacement end time (seconds)
end_s must be greater than start_s and cannot exceed the source clip's duration.
instruction stringEditing instruction for the replaced section
Example: "Replace with a piano version"
title stringTitle of the music after replacement
seed integerRandom seed, used to reproduce or control the generation result
Response
code integerResponse status code, 200 on success
data arraystatus stringTask status, submitted upon initial submission
task_id stringUnique task identifier, used to query task status and results
Use Cases
Scenario 1: Replace seconds 10-20 with a piano version
{
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "Replace with a piano version"
}Query Task Results
Section replacement is an asynchronous task; a task_id is returned after submission. Use the Get Task Status endpoint to query generation progress and results. The replacement output is a new clip_id (the whole song is re-rendered with the specified segment replaced); use the new clip_id for subsequent operations.
Completed Task Result Example
Query response example (GET /v1/music/tasks/{task_id}):
{
"code": 200,
"data": {
"id": "task_01KWXVHGTG5JM33S8FG1K90YQ6",
"status": "completed",
"progress": 100,
"created": 1783413392,
"completed": 1783413454,
"actual_time": 62,
"cost": 0.048,
"credits_cost": 0.48,
"result": {
"music": [
{
"clip_id": "9508d1fe-633e-464b-8a40-c6368e5464fa",
"title": "Untitled (Replaced)",
"duration_seconds": "181.58933333",
"create_time": "2026-07-07T08:37:13.864452Z",
"lyrics": "[Verse 1]\nWaking up to the morning light,\n...",
"lyrics_id": "c302d603-81b6-552f-8122-e512928d6aa1",
"lyrics_timing_markers": [[10, 12], [71, 15]],
"audio_url": "https://cdn.openveer.com/audio/flowmusic_9508d1fe.m4a",
"wav_url": "https://cdn.openveer.com/audio/flowmusic_9508d1fe.wav",
"image_url": "https://cdn.openveer.com/image/flowmusic_9508d1fe_cover.jpg"
}
]
}
}
}This documentation is built and hosted on Mintlify, a developer documentation platform.