Appearance
Upload And Extend Audio
POST
/api/v1/generate/upload-extend
This API extends audio tracks while preserving their original style. It includes Suno's upload functionality, allowing users to upload audio files for processing. The expected result is a longer track that seamlessly continues the input style.
Parameter Usage Guide #
Character Limits
Character limits vary depending on the model version:
Model V5_5 and V5: style (max 1000 chars), title (max 100 chars), prompt (max 5000 chars)
Models V4.5PLUS and V4.5: style (max 1000 chars), title (max 100 chars), prompt (max 5000 chars)
Model V4.5ALL: style (max 1000 chars), title (max 80 chars), prompt (max 5000 chars)
Model V4: style (max 200 chars), title (max 80 chars), prompt (max 3000 chars)
When defaultParamFlag is true (Custom Parameters):
If instrumental is true: style, title, and uploadUrl are required.
If instrumental is false: style, prompt, title, and uploadUrl are required.
Character limits vary by model version (see note above).
continueAt: The time point in seconds from which to start extending (must be greater than 0 and less than the uploaded audio duration).
uploadUrl: Specifies the upload location for audio files; ensure uploaded audio does not exceed 8 minutes.
When defaultParamFlag is false (Default Parameters):
Regardless of the instrumental setting, only uploadUrl and prompt are required.
Other parameters will use the original audio's parameters.
Developer Notes #
Generated files will be retained for 14 days.
The model version used must be consistent with the source music's model version.
This feature is ideal for creating longer works by extending existing music.
The uploadUrl parameter specifies the upload location for audio files; provide a valid URL.
Optional Parameters #
vocalGender (string): Vocal gender preference. Use m for male, f for female.
styleWeight (number): Strength of adherence to the style. Range 0-1, up to 2 decimal places. Example: 0.65.
weirdnessConstraint (number): Controls creative deviation. Range 0-1, up to 2 decimal places. Example: 0.65.
audioWeight (number): Balance weight for audio features. Range 0-1, up to 2 decimal places. Example: 0.65.
personaId (string): Persona ID to apply to the generated music. Only available when Custom Mode is enabled (i.e., defaultParamFlag is true). To create one, use Generate Persona.
Callbacks
audioExtend
POST
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
Generate Code
uploadUrl
string<uri>
required
The URL for uploading audio files, required regardless of whether defaultParamFlag is true or false. Ensure the uploaded audio does not exceed 8 minutes in length.
Example: https://storage.example.com/upload
defaultParamFlag
boolean
required
Enable custom mode for advanced audio generation settings.
Set to true to use custom parameter mode (requires style, title, and uploadUrl; if instrumental is false, uploadUrl and prompt are required). If instrumental is false, the prompt will be strictly used as lyrics.
Set to false to use non-custom mode (only uploadUrl required). Lyrics will be automatically generated based on the prompt.
Example: true
instrumental
boolean
required
Determines whether the audio is instrumental (without lyrics).
In custom parameter mode (customMode: true):
If true: only style, title, and uploadUrl are required.
If false: style, title, prompt (prompt will be used as exact lyrics), and uploadUrl are required.
In non-custom parameter mode (defaultParamFlag: false): does not affect required fields (only uploadUrl needed). If false, lyrics will be automatically generated.
Example: true
prompt
string
optional
Description of how the music should be extended. Required when defaultParamFlag is true. Character limits by model:
V5_5 & V5: Maximum 5000 characters
V4_5PLUS & V4_5: Maximum 5000 characters
V4_5ALL: Maximum 5000 characters
V4: Maximum 3000 characters
Example: Extend the music with more relaxing notes
style
string
optional
Music style, e.g., Jazz, Classical, Electronic. Character limits by model:
V5_5 & V5: Maximum 1000 characters
V4_5PLUS & V4_5: Maximum 1000 characters
V4_5ALL: Maximum 1000 characters
V4: Maximum 200 characters
Example: Classical
title
string
optional
Music title. Character limits by model:
V5_5 & V5: Maximum 100 characters
V4_5PLUS & V4_5: Maximum 100 characters
V4_5ALL: Maximum 80 characters
V4: Maximum 80 characters
Example: Peaceful Piano Extended
continueAt
number
required
The time point (in seconds) from which to start extending the music.
Required when defaultParamFlag is true.
Value range: greater than 0 and less than the total duration of the uploaded audio.
Specifies the position in the original track where the extension should begin.
Example: 60
model
enum<string>
required
The AI model version to use for generation.
Required for all requests.
Available options:
V5_5:Custom Models Tailored to Your Unique Taste.
V5: Superior musical expression, faster generation.
V4_5PLUS: V4.5+ delivers richer sound, new ways to create, max 8 min.
V4_5: V4.5 enables smarter prompts, faster generations, max 8 min.
V4_5ALL: V4.5ALL enables smarter prompts, faster generations, max 8 min.
V4: V4 improves vocal quality, max 4 min.
Allowed values: V4V4_5V4_5PLUSV4_5ALLV5V5_5
Example: V4
negativeTags
string
optional
Music styles to exclude from generation
Example: Relaxing Piano
callBackUrl
string<uri>
required
The URL to receive audio extension task completion updates. Required for all audio extension requests.
System will POST task status and results to this URL when audio extension completes
Callback includes extended audio files that seamlessly continue the uploaded track's style
Your callback endpoint should accept POST requests with JSON payload containing extended track results and audio URLs
For detailed callback format and implementation guide, see Audio Extension Callbacks
Alternatively, use the Get Music Details endpoint to poll task status
To ensure callback security, see Webhook Verification Guide for signature verification implementation
Example: https://api.example.com/callback
vocalGender
enum<string>
optional
Vocal gender preference for the singing voice. Optional. Use 'm' for male and 'f' for female. Based on practice, this parameter can only increase the probability but cannot guarantee adherence to male/female voice instructions.
Allowed values: mf
Example: m
styleWeight
number
optional
Strength of adherence to the specified style. Optional. Range 0-1, up to 2 decimal places.
= 0<= 1
Example: 0.65
Multiple of: 0.01
weirdnessConstraint
number
optional
Controls experimental/creative deviation. Optional. Range 0-1, up to 2 decimal places.
= 0<= 1
Example: 0.65
Multiple of: 0.01
audioWeight
number
optional
Balance weight for audio features vs. other factors. Optional. Range 0-1, up to 2 decimal places.
= 0<= 1
Example: 0.65
Multiple of: 0.01
personaId
string
optional
Only available when Custom Mode (customMode: true) is enabled. Persona ID or Voice ID to apply to the generated music. Optional. Use this to apply a specific persona style to your music generation.To generate a persona ID, use the Generate Persona endpoint to create a personalized music Persona based on generated music.To generate a Voice ID, use the Generate Voice endpoint
Example: persona_123
personaModel
enum<string>
optional
The persona model is only available for models version 5 and 5.5.
Allowed values: style_personavoice_persona
Examples
Responses
🟢200
application/json
Request successful
Bodyapplication/json
Generate Code
code
enum<integer>
optional
Response status code
200: Success - Request has been processed successfully
401: Unauthorized - Authentication credentials are missing or invalid
402: Insufficient Credits - Account does not have enough credits to perform the operation
404: Not Found - The requested resource or endpoint does not exist
409: Conflict - WAV record already exists
422: Validation Error - The request parameters failed validation checks
429: Rate Limited - Request limit has been exceeded for this resource
451: Unauthorized - Failed to fetch the image. Kindly verify any access limits set by you or your service provider.
455: Service Unavailable - System is currently undergoing maintenance
500: Server Error - An unexpected error occurred while processing the request
Allowed values: 200401402404409422429451455500
msg
string
optional
Error message when code != 200
Example: success
data
object
optional
taskId
string
optional
Task ID for tracking task status
Example: 5c79****be8e
🔴500Error
Request Request Example
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
cURLcURL-WindowsHttpiewgetPowerShell
curl --location 'https://api.kie.ai/api/v1/generate/upload-extend' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"uploadUrl": "https://storage.example.com/upload",
"defaultParamFlag": true,
"instrumental": true,
"continueAt": 60,
"model": "V4",
"callBackUrl": "https://api.example.com/callback",
"prompt": "Extend the music with more relaxing notes",
"style": "Classical",
"title": "Peaceful Piano Extended",
"negativeTags": "Relaxing Piano",
"vocalGender": "m",
"styleWeight": 0.65,
"weirdnessConstraint": 0.65,
"audioWeight": 0.65,
"personaId": "persona_123",
"personaModel": "style_persona"
}'Response Response Example
200 - Example 1
{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e"
}
}