KIE.AI
old-model
  • All Model
  • old-model
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
old-model
  • All Model
  • old-model
old-model
  • All Model
  • old-model
Suno API
4o Image APIVeo3.1 APIRunway APIFlux Kontext API
Suno API
4o Image APIVeo3.1 APIRunway APIFlux Kontext API
  1. Music Generation
  • Suno API Quickstart
  • Music Generation
    • Music Cover Generation Callbacks
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Audio Upload and Cover Callbacks
    • Audio Upload and Extension Callbacks
    • Add Instrumental Callbacks
    • Add Vocals 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
    • Generate Music Cover
      POST
    • Get Cover Generation Details
      GET
    • Replace Music Section
      POST
    • Generate Persona
      POST
    • Generate Mashup Music
      POST
    • Recovery Audio
      POST
  • Lyrics Generation
    • Lyrics Generation Callbacks
    • Generate Lyrics
      POST
    • Get Lyrics Task Details
      GET
  • WAV Conversion
    • Convert to WAV Callbacks
    • Convert to WAV Format
    • Get WAV Conversion Details
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Vocal & Instrument Stem Separation
    • 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
  • Sounds Generation
    • Generate sounds
  • voice
    • Suno Voice Generation Callback
    • Suno Voice Validation Phrase Callback
    • Suno Voice Generate Verification Phrase API
    • Suno Voice Get Verification Phrase API
    • Suno Voice Create Custom Voice API
    • Suno Voice Get Custom Voice Records
    • Suno Voice Regenerate Verification Phrase
    • Suno Voice Check Availability 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.

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 must be at least 10 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
Bodyapplication/json

🔴500Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.kie.ai/api/v1/generate/replace-section' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "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