Skip to main content
POST
/
api
/
v1
/
generate
/
upload-extend
Upload And Extend Audio
curl --request POST \
  --url https://api.sunoapi.org/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,
  "prompt": "Extend the music with more relaxing notes",
  "style": "Classical",
  "title": "Peaceful Piano Extended",
  "continueAt": 60,
  "model": "V3_5",
  "negativeTags": "Relaxing Piano",
  "vocalGender": "m",
  "styleWeight": 0.65,
  "weirdnessConstraint": 0.65,
  "audioWeight": 0.65,
  "callBackUrl": "https://api.example.com/callback"
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "5c79****be8e"
  }
}
This API extends audio tracks while preserving the original style of the audio track. 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.

Upload Requirements

  • File Duration: Maximum 2 minutes
  • Upload URL: Always required regardless of parameter mode
  • File Format: Standard audio formats supported

Parameter Modes

Custom Parameter Mode (defaultParamFlag: true)

When enabled, you have full control over the extension parameters:
  • If instrumental is true: Requires style, title, uploadUrl, and continueAt
  • If instrumental is false: Requires style, title, prompt, uploadUrl, and continueAt
  • The prompt will be used as exact lyrics when instrumental is false

Non-Custom Parameter Mode (defaultParamFlag: false)

Simplified mode that uses the original audio’s characteristics:
  • Required fields: Only uploadUrl
  • Automatic processing: Extension maintains original style automatically
  • Lyrics handling: Auto-generated if not instrumental

Extension Process

  1. Upload: Provide your source audio file (max 2 minutes)
  2. Continuation Point: Specify where to start extending (continueAt parameter)
  3. Style Preservation: Algorithm analyzes and maintains original characteristics
  4. Seamless Extension: Creates natural continuation of your audio

Key Features

  • Style Consistency: Maintains the original audio’s musical style
  • Natural Flow: Seamless transitions from original to extended sections
  • Flexible Duration: Extend as needed while preserving quality
  • Advanced Controls: Fine-tune style weight and creative constraints

Best Practices

  • Continuation Point: Choose a natural break point in the music
  • Model Consistency: Ensure model version matches your quality needs
  • Style Weight: Adjust to balance originality vs. consistency
  • Audio Quality: Higher quality input produces better extensions
Perfect for extending your favorite tracks while keeping their original character and feel intact.

Authorizations

Authorization
string
header
required

🔑 API Authentication

All endpoints require authentication using Bearer Token.

Get API Key

  1. Visit the API Key Management Page to obtain your API Key

Usage

Add to request headers:

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 from the management page

Body

application/json
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 2 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

model
enum<string>
required

Model version to use, must be consistent with the source audio

Available options:
V3_5,
V4,
V4_5,
V4_5PLUS
Example:

"V3_5"

callBackUrl
string<uri>
required

The URL to receive task completion notifications when music extension is complete. For detailed callback format and implementation guide, see Upload and Extend Audio Callbacks. Alternatively, you can use the get music generation details endpoint to poll task status.

Example:

"https://api.example.com/callback"

instrumental
boolean

Determines whether the audio is instrumental (without lyrics). In custom parameter mode (defaultParamFlag: 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

Description of how the music should be extended. Required when defaultParamFlag is true.

Example:

"Extend the music with more relaxing notes"

style
string

Music style, e.g., Jazz, Classical, Electronic

Example:

"Classical"

title
string

Music title

Example:

"Peaceful Piano Extended"

continueAt
number

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

negativeTags
string

Music styles to exclude from generation

Example:

"Relaxing Piano"

vocalGender
enum<string>

Preferred vocal gender for generated vocals. Optional.

Available options:
m,
f
Example:

"m"

styleWeight
number

Weight of the provided style guidance. Range 0.00–1.00.

Required range: 0 <= x <= 1Must be a multiple of 0.01
Example:

0.65

weirdnessConstraint
number

Constraint on creative deviation/novelty. Range 0.00–1.00.

Required range: 0 <= x <= 1Must be a multiple of 0.01
Example:

0.65

audioWeight
number

Weight of the input audio influence (where applicable). Range 0.00–1.00.

Required range: 0 <= x <= 1Must be a multiple of 0.01
Example:

0.65

Response

Request successful

code
enum<integer>

Status code. 200 - Request successful, 400 - Invalid parameters, 401 - Unauthorized access, 404 - Invalid request method or path, 405 - Rate limit exceeded, 413 - Theme or prompt too long, 429 - Insufficient credits, 430 - Your call frequency is too high. Please try again later, 455 - System maintenance, 500 - Server error

Available options:
200,
400,
401,
404,
405,
413,
429,
430,
455,
500
Example:

200

msg
string

Error message when code != 200

Example:

"success"

data
object