MusicAPI
HomeDocs
HomeDocs
  1. sonic
  • Introduction
  • Credits Usage Guide
  • Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • sonic
    • Sonic Instructions
    • create / extend / cover music
      POST
    • upload and extend music
      POST
    • upload and cover music
      POST
    • create persona
      POST
    • sample
      POST
    • mashup
      POST
    • get BPM
      POST
    • get VOX
      POST
    • get wav
      POST
    • get midi
      POST
    • get lyrics timeline
      POST
    • upsample tags
      POST
    • concat music
      POST
    • stems basic
      POST
    • stems full
      POST
    • upload music
      POST
    • get music
      GET
  • riffusion(Deprecated)
    • Riffusion instructions
    • create music (with lyrics)
      POST
    • create music (with description)
      POST
    • cover music
      POST
    • extend music
      POST
    • replace music section
      POST
    • swap music sound
      POST
    • swap music vocals
      POST
    • upload
      POST
    • get music
      GET
  • producer
    • Producer instructions
    • Complete Request Examples
    • create music
    • upload
    • download
    • get music
  • studio(Unavailable)
    • Studio Instructions
    • description mode (Use case1)
    • extend mode (Use case2)
    • custom mode (Use case3)
    • instrumental mode (Use case4)
    • get music
  • lyrics generation
    • Make Lyrics
  • nuro
    • Nuro Instruction
    • Error handling
    • create vocal music
    • create instrument music
    • get music
  • get-credits
    GET
  • Schemas
    • 记录不存在
    • 参数不正确
HomeDocs
HomeDocs
  1. sonic

upload and extend music

POST
https://api.musicapi.ai/api/v1/sonic/upload-extend
One-stop API to upload an audio file and extend it with new content. This combines the upload and extend operations into a single request.
Credits cost: 15
Workflow:
1.
Upload the audio file to get a clip_id
2.
Extend the uploaded clip with the specified parameters
3.
Poll the result using get-music endpoint with the returned task_id

Polling Result#

Use GET /api/v1/sonic/task/{task_id} to poll the result.

Standard Response (auto_concat: false)#

{
  "code": 200,
  "data": [
    {
      "clip_id": "ext-clip-1",
      "state": "succeeded",
      "title": "My Song",
      "audio_url": "https://cdn1.suno.ai/ext-clip-1.mp3",
      "duration": 60
    }
  ],
  "message": "success"
}

Auto-Concat Response (auto_concat: true)#

When auto_concat is enabled, the response contains paired objects:
Stage 1: Extend completed, concat in progress
{
  "code": 200,
  "data": [
    {
      "extended": { "clip_id": "ext-clip-1", "state": "succeeded", "duration": 60, ... },
      "full": null
    }
  ],
  "message": "extend completed, concat in progress"
}
Stage 2: Fully completed
{
  "code": 200,
  "data": [
    {
      "extended": { "clip_id": "ext-clip-1", "state": "succeeded", "duration": 60, ... },
      "full": { "clip_id": "concat-clip-1", "state": "succeeded", "duration": 240, ... }
    }
  ],
  "message": "success"
}
The extended and full fields are paired - each full song is the concatenation of the original + corresponding extended segment.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Body Params application/json

Example
{
    "url": "https://cdn1.suno.ai/5b36a0b8-f96d-496b-aea4-f5cb01d11ba2.mp3",
    "mv": "sonic-v4-5",
    "custom_mode": true,
    "prompt": "[Verse]\nStars they shine above me\nMoonlight softly glows\n\n[Chorus]\nStarry night starry night\nLet your light ignite",
    "title": "Starry Night Extended",
    "tags": "pop,rock",
    "continue_at": 180,
    "auto_concat": true
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.musicapi.ai/api/v1/sonic/upload-extend' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://cdn1.suno.ai/5b36a0b8-f96d-496b-aea4-f5cb01d11ba2.mp3",
    "mv": "sonic-v4-5",
    "custom_mode": true,
    "prompt": "[Verse]\nStars they shine above me\nMoonlight softly glows\n\n[Chorus]\nStarry night starry night\nLet your light ignite",
    "title": "Starry Night Extended",
    "tags": "pop,rock",
    "continue_at": 180,
    "auto_concat": true
}'

Responses

🟢200success
application/json
Success
Body

Example
{
    "code": 200,
    "message": "success",
    "task_id": "81ed9f60-56ae-48c1-9c46-33a8220dfca7",
    "steps": {
        "upload": {
            "success": true,
            "clip_id": "cfbc3d3c-2add-4265-bcdf-924092096e3d"
        },
        "extend": {
            "success": true,
            "task_id": "81ed9f60-56ae-48c1-9c46-33a8220dfca7"
        }
    }
}
Modified at 2026-01-16 05:40:53
Previous
create / extend / cover music
Next
upload and cover music
Built with