POST
/
api
/
v1
/
generate
/
extend
Extend Music
curl --request POST \
  --url https://api.kie.ai/api/v1/generate/extend \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "defaultParamFlag": true,
  "audioId": "5c79****be8e",
  "prompt": "Extend the music with more relaxing notes and a gentle bridge section",
  "style": "Classical",
  "title": "Peaceful Piano Extended",
  "continueAt": 60,
  "model": "V3_5",
  "callBackUrl": "https://api.example.com/callback",
  "negativeTags": "Heavy Metal, Upbeat Drums",
  "vocalGender": "m",
  "styleWeight": 0.65,
  "weirdnessConstraint": 0.65,
  "audioWeight": 0.65
}'
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "5c79****be8e"
  }
}

Usage Guide

  • This endpoint allows you to extend existing music tracks
  • You can choose to use original parameters or set new custom parameters
  • Extended music will maintain style consistency with the source track

Parameter Details

  • With Custom Parameters (defaultParamFlag: true):
    • prompt, style, title and continueAt are required
    • prompt length limit: 3000 characters
    • style length limit: 200 characters
    • title length limit: 80 characters
  • With Original Parameters (defaultParamFlag: false):
    • Only audioId is required
    • Other parameters will be inherited from the source audio

Developer Notes

  • Generated files are retained for 14 days
  • Model version must match the source audio’s model version
  • Callback process follows the same pattern as the music generation endpoint

Optional parameters

  • vocalGender (string): Vocal gender preference. Use m for male, f for female.
  • styleWeight (number): Strength of adherence to style. Range 0–1, up to 2 decimals. Example: 0.65.
  • weirdnessConstraint (number): Controls creative deviation. Range 0–1, up to 2 decimals. Example: 0.65.
  • audioWeight (number): Balance weight for audio features. Range 0–1, up to 2 decimals. Example: 0.65.

Authorizations

Authorization
string
header
required

All APIs require authentication via Bearer Token.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header: Authorization: Bearer YOUR_API_KEY

Note:

  • Keep your API Key secure and do not share it with others
  • If you suspect your API Key has been compromised, reset it immediately in the management page

Body

application/json

Response

200
application/json

Request successful

The response is of type object.