Skip to main content

Endpoint

POST /api/v1/music/infill
Asynchronous. Returns a task_id. Poll Get Task for results. Replaces a specified time range within an existing clip with new AI-generated content while keeping the rest of the track intact. Useful for fixing or improving a specific section.

Request body

FieldTypeRequiredDescription
clip_idstringYesClip ID of the source track.
infill_start_sfloatYesStart time (seconds) of the section to replace.
infill_end_sfloatYesEnd time (seconds) of the section to replace.
promptstringNoDescription or lyrics for the replacement section. Supports Chinese and English.
tagsstringNoStyle tags (e.g. "摇滚 吉他" or "rock guitar").
mvstringNoModel version override.
callback_urlstringNoWebhook URL for completion notification. See Webhooks.
retention_daysintegerNoDays to retain audio files. Default 7.

Response

{
  "code": 0,
  "message": "ok",
  "request_id": "req-1710000000000",
  "data": {
    "task_id": "64f3a1b2c8d9e0f1a2b3c4d5",
    "status": "queuing"
  }
}

Example

curl -X POST https://api.example.com/api/v1/music/infill \
  -H "Authorization: Bearer sk-mm-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "clip_id": "abc123def456",
    "infill_start_s": 45.0,
    "infill_end_s": 60.0,
    "prompt": "[桥段]\n电吉他独奏,充满力量",
    "tags": "摇滚 吉他独奏"
  }'