Suno: sample
Generate a song from a sampled range of a prior track.
Action facts
| Property | Value |
|---|---|
| Model | suno |
| Action | sample |
| Endpoint | POST /api/v1/generation/create |
| Result | audio in files |
| Pricing | View current pricing |
Minimal request
curl -X POST https://api.api-stock.com/api/v1/generation/create \
-H "Authorization: Bearer $API_STOCK_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "suno",
"input": {
"action": "sample",
"sourceTaskId": "019ca881-9503-7270-a560-f00fc2b15785",
"startS": 10,
"endS": 25
}
}'{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "not_started",
"createdAt": "2026-08-22T12:00:00.000Z"
}
}Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
action | “music” | “extend” | “cover” | “add-instrumental” | “add-vocals” | “sound” | “stems” | “stems-all” | “wav” | “lyrics” | “voice” | “timestamped-lyrics” | “boost-style” | “music-cover” | “replace-section” | “music-video” | “inspo” | “upload” | “remaster” | “add-stem” | “vox” | “remove-section” | “crop” | “fade-in” | “fade-out” | “adjust-speed” | “concat” | “mashup” | “sample” | “midi” | “bpm” | “custom-model” | Yes | "music" | Suno operation |
mv | string | No | — | Engine version. Audio actions: v6 (default) | v6-wild | v6-mini | custom. The retired versions v3.5 … v5.5 are still accepted and run on v6. lyrics: remi-v1 | default. Not used by stems/stems-all/wav/voice. variety, maxMode, audioFormat, duration and customModelId need a V6 engine (any value except custom). |
custom | boolean | No | — | false for simple mode, true for custom mode |
gptDescriptionPrompt | string | No | — | Simple mode: song / effect description (with optional lyrics) |
prompt | string | No | — | Custom mode: detailed lyrics / prompt (also the lyrics or sound description) |
tags | string | No | — | Custom mode: genre / style tags |
title | string | No | — | Title for the result |
customModelId | string | No | — | Id of a reusable custom model created by the custom-model action (its output.customModelId). Generates in that model’s style; cannot be combined with mv or personaId. |
variety | “off” | “normal” | “high” | “extra” | “max” | No | — | Style variation: off | normal | high | extra | max. V6 generative actions. |
maxMode | boolean | No | false | Max mode: higher-quality V6 generation, billed at twice the regular price. Requires custom mode, except on inspo and replace-section. |
audioFormat | “mp3” | “m4a” | “wav” | No | — | Output audio format: mp3 | m4a | wav. V6 generative actions plus sound, remaster, stems and stems-all. |
sourceTaskId | string | Yes | — | Reference to one of your prior Suno generations (its taskId), used by stateful actions such as extend, music-cover, replace-section, timestamped-lyrics, music-video, voice and wav. |
startS | number | Yes | — | Start time (seconds) of the affected range. Used by remove-section / crop / sample (the range), replace-section (the infill range) and vox / voice-from-track (the vocal window). |
endS | number | Yes | — | End time (seconds) of the affected range (> startS). See startS for the actions that use it. |
Conditional rules: Requires sourceTaskId, startS, and endS; endS must be greater than startS.
Only send fields relevant to this action. When a request references sourceTaskId, the source must be a successful Suno task owned by the same account.
Result
curl https://api.api-stock.com/api/v1/task/status/$TASK_ID \
-H "Authorization: Bearer $API_STOCK_KEY"You can instead provide a top-level webhook. The task reaches finished, failed or expired; failed generations are refunded automatically. Data actions return output, while media actions return files.
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "finished",
"files": [
{
"fileUrl": "https://s3.api-stock.com/result.mp3",
"fileType": "music"
}
],
"createdTime": "2026-08-22T12:00:00.000Z"
}
}