KIE.AI
English
  • English
  • Chinese
English
  • English
  • Chinese
Support
English
  • English
  • Chinese
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
  1. Music Generation
  • Suno API Quickstart
  • Music Generation
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Audio Upload and Cover Callbacks
    • Audio Upload and Extension Callbacks
    • Add Instrumental Callbacks
    • Add Vocals Callbacks
    • Music Cover Generation Callbacks
    • Replace Music Section Callbacks
    • Generate Music
      POST
    • Extend Music
      POST
    • Upload And Cover Audio
      POST
    • Upload And Extend Audio
      POST
    • Add Instrumental to Music
      POST
    • Add Vocals to Music
      POST
    • Get Music Task Details
      GET
    • Get Timestamped Lyrics
      POST
    • Boost Music Style
      POST
    • Create Suno Cover Task
      POST
    • Get Cover Generation Details
      GET
    • Replace Music Section
      POST
    • Generate Persona
      POST
  • Lyrics Generation
    • Lyrics Generation Callbacks
    • Generate Lyrics
      POST
    • Get Lyrics Task Details
      GET
  • WAV Conversion
    • Convert to WAV Callbacks
    • Convert to WAV Format
      POST
    • Get WAV Conversion Details
      GET
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Separate Vocals from Music
    • Get Vocal Separation Details
    • Generate MIDI from Audio
    • Get MIDI Generation Details
  • Music Video Generation
    • Music Video Generation Callbacks
    • Create Music Video
    • Get Music Video Details
English
  • English
  • Chinese
Support
English
  • English
  • Chinese
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
  1. Music Generation

Replace Music Section

POST
/api/v1/generate/replace-section
Replace a specific time segment within existing music.
This interface can replace specific time segments in already generated music. It requires providing the original music's task ID and the time range to be replaced. The replaced audio will naturally blend with the original music.

Parameter Details#

Required Parameters#

taskId: Original music's parent task ID
audioId: Audio ID to replace
prompt: Prompt describing the replacement segment content
tags: Music style tags
title: Music title
infillStartS: Start time point for replacement (seconds, 2 decimal places)
infillEndS: End time point for replacement (seconds, 2 decimal places)

Optional Parameters#

negativeTags: Music styles to exclude
fullLyrics: Complete lyrics after modification, combining both modified and unmodified lyrics
callBackUrl: Callback address after task completion

Time Range Instructions#

infillStartS must be less than infillEndS.
Time values are precise to 2 decimal places, e.g., 10.50 seconds.
The replacement time range must be between 6 and 60 seconds.
Replacement duration should not exceed 50% of the original music's total duration.

Developer Notes#

Replacement segments will be regenerated based on the provided prompt and tags.
Generated replacement segments will automatically blend with the original music's preceding and following parts.
Generated files will be retained for 14 days.
Query task status using the same interface as generating music: Get Music Details.

Callbacks

audioGenerated

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Request successful
Body

🔴500Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.kie.ai/api/v1/generate/replace-section' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "taskId": "2fac****9f72",
    "audioId": "e231****-****-****-****-****8cadc7dc",
    "prompt": "A calm and relaxing piano track.",
    "tags": "Jazz",
    "title": "Relaxing Piano",
    "negativeTags": "Rock",
    "infillStartS": 10.5,
    "infillEndS": 20.75,
    "fullLyrics": "[Verse 1]\nOriginal lyrics here\n[Chorus]\nModified lyrics for this section\n[Verse 2]\nMore original lyrics",
    "callBackUrl": "https://example.com/callback"
}'
Response Response Example
200 - Example 1
{
    "code": 200,
    "msg": "success",
    "data": {
        "taskId": "5c79****be8e"
    }
}
Previous
Get Cover Generation Details
Next
Generate Persona
Built with