Get API Key Get API
Docs

Replace Section

Flow Music replaces a section of previously generated audio. Regenerates the segment between start_s and end_s according to an editing instruction

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"
  }'

Response example

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

Authentication

Authorization string

All 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_KEY

Request Parameters

model string

Model name, must be "flowmusic" (case-insensitive)

clip_id string

Source music clip_id, from a successful task's result.music[].clip_id

start_s number

Replacement start time (seconds)

end_s number

Replacement end time (seconds)

Warning



end_s must be greater than start_s and cannot exceed the source clip's duration.

instruction string

Editing instruction for the replaced section

Example: "Replace with a piano version"

title string

Title of the music after replacement

seed integer

Random seed, used to reproduce or control the generation result

Response

code integer

Response status code, 200 on success

data array
Array of returned data
status string

Task status, submitted upon initial submission

task_id string

Unique 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"
}
Note

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.