Sample API
Endpoint description
Sampling takes a piece of material from an existing song and generates a new song from it. Currently the customer-facing mode is the chop sample mode.
Endpoint: POST /api/music/sample
Billing: Paid, billed by the requested model; the amount actually charged follows the back-office price configuration.
Max Mode / Variety: this endpoint supports the optional parameters max_mode and variety (0-4). With
max_mode on, this call is billed at 2× the price; variety costs nothing extra. What they mean and how to send
them is in the "Advanced parameters" section of the New API overview.
Recommended model: suno-v6. suno-v6, suno-v6-wild and suno-v6-mini are available.
Wait times and timeouts (important): this is a synchronous endpoint — the order is only accepted and handed to generation when the response arrives. Measured, most requests return in 1-3 seconds, about 10% take longer than 30 seconds, and the longest is about 230 seconds. Set your client timeout to 300 seconds or more; no response does not mean nothing was generated, and do not retry immediately after a timeout (that duplicates the order and charges again). If the connection dropped, confirm later with
GET /api/music/songs. See "Wait times and timeout settings" in the New API overview.
Authentication
| Parameter | Type | Required | Notes |
|---|---|---|---|
| Authorization | string | yes | Bearer YOUR_API_KEY |
| Content-Type | string | yes | application/json |
Request parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| model | string | yes | - | Customer-facing model name: suno-v6, suno-v6-wild or suno-v6-mini |
| source_clip_id | string | yes | - | The real song_id of the source song; it must be completed and accessible to the current API key |
| mode | string | yes | - | Only chop is supported at present |
| start_seconds | number | yes | - | Start second of the sample; must be 0 or greater |
| end_seconds | number | yes | - | End second of the sample; must be greater than start_seconds |
| lyrics | string | no | - | Lyrics or a creative direction |
| style_tags | string | no | - | Style tags |
| song_title | string | no | - | Title of the result |
| wait_completion | boolean | no | false | Whether to wait a long time before responding |
Request example
curl -X POST https://www.suno-api.io/api/music/sample \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-v6",
"source_clip_id": "source_song_id",
"mode": "chop",
"start_seconds": 0,
"end_seconds": 30,
"style_tags": "funky pop, chopped sample",
"song_title": "Sample version",
"wait_completion": false
}'
Response
{
"code": 200,
"message": "success",
"data": {
"clips": [
{
"song_id": "result_song_id",
"song_title": "Sample version",
"status": "pending"
},
{
"song_id": "result_song_id_2",
"song_title": "Sample version",
"status": "pending"
}
]
}
}
One call returns 2 results (billed as 2 songs); the example shows 2. Judge by the length of the clips array and do not hard-code a fixed count. Save clips[].song_id and poll the song query API until completed.
Notes
- Only the
chopmode is open at present. as-is,as_is,asisandblendcurrently return HTTP 400 and do not submit a generation task.start_secondsmust be 0 or greater, and must be less thanend_seconds.
Get an API key
Create an API key in the console after signing up. ¥0.6 per run returns 2 tracks, downloads are unlimited, and no phone number is required.
Get API key Back to overview