All models
Suno
Music
Available
Suno Replace Music Section
If you have already completed the integration process previously, you can still access the old version document at: Old version address (https://docs.kie.ai/old-model/suno-api/replace-section) > Replace a specific time segment within existing music.
Text to Music
From 150 credits (≈ ₹150.00) per request.
Parameters
| Parameter | Type | Description |
|---|---|---|
promptRequired |
string | The lyrics after replacement. Required. |
tagsRequired |
string | Style tags for the music, such as jazz or electronic. Required. |
titleRequired |
string | The title of the music. Required. |
negative_tags |
string | Music styles to exclude, used to prevent specific stylistic elements from appearing in the replacement section. |
infill_start_sRequired |
number | The point in time, in seconds, at which replacement starts, rounded to 2 decimal places. Required. Must be less than infill_end_s, and the difference between infill_end_s and infill_start_s must be at least 10 seconds. min 0 |
infill_end_sRequired |
number | The point in time, in seconds, at which replacement ends, rounded to 2 decimal places. Required. Must be greater than infill_start_s, and the difference between infill_end_s and infill_start_s must be at least 10 seconds. min 0 |
full_lyricsRequired |
string | The complete modified lyrics, combining the modified and unmodified lyrics. Required. This parameter contains the complete lyrics text that will be used for the entire song after section replacement. |
lyrics |
string | Lyrics for the replaced segment. Optional. - V6, V6_MINI, and V6_WILD: Maximum 5000 characters. max length 5000 |
vocal_gender |
string | Vocal gender preference. Optional. 'm' for male, 'f' for female. Based on practice, this parameter can only increase the probability but cannot guarantee adherence to male/female voice instructions. one of: "m", "f" |
style_weight |
number | Adherence strength to specified style. Optional. Range 0–1, up to 2 decimal places. min 0 · max 1 |
weirdness_constraint |
number | Controls experimental/creative deviation level. Optional. Range 0–1, up to 2 decimal places. min 0 · max 1 |
audio_weight |
number | Relative weight of audio elements. Optional. Range 0–1, up to 2 decimal places. min 0 · max 1 |
variety |
integer | Controls the diversity and stylistic variation of generated results. Optional. Integer range 0–4, default 1. - **`0`**: off (exact style) — fully off, strictly the same style - **`1`**: normal (balanced variety) — default, balances stability and diversity - **`2`**: high (distinct styles) — produces results with clearly different styles - **`3`**: extra (bold exploration) — higher variation, encourages bold exploration of different styles - **`4`**: max (unreasonably varied) — maximum diversity; min 0 · max 4 · default 1 |
persona_id |
string | 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](https://docs.kie.ai/suno-api/generate-persona) endpoint to create a personalized music Persona based on generated music. To generate a Voice ID, use the [Generate Voice](https://docs.kie.ai/suno-api/suno-voice-generate) endpoint. |
persona_model |
string | Persona model. Optional. Use `style_persona` for Generate Persona IDs, or `voice_persona` for Suno Voice IDs. Default: `style_persona`. Available for V5 (Discontinued), V5_5 (Discontinued), V6, V6_MINI, and V6_WILD. one of: "style_persona", "voice_persona" · default "style_persona" |
What you get back
Files arrive in output.files[] as private links that expire, with their type and size.
Use it from your code
# 1. Create the task
curl https://nexus.promptscenes.in/api/v1/tasks \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "suno-replace-music-section",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"tags": "…",
"title": "…",
"infill_start_s": 0,
"infill_end_s": 0,
"full_lyrics": "…",
"vocal_gender": "m",
"variety": 1,
"persona_model": "style_persona"
},
"callback_url": "https://your-app.com/webhooks/nexus"
}'
# 2. Poll for the result
curl https://nexus.promptscenes.in/api/v1/tasks/TASK_ID \
-H "Authorization: Bearer $NEXUS_API_KEY"
import os, time, uuid, requests
API = "https://nexus.promptscenes.in/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['NEXUS_API_KEY']}"}
task = requests.post(
f"{API}/tasks",
headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
json={
"model": "suno-replace-music-section",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"tags": "…",
"title": "…",
"infill_start_s": 0,
"infill_end_s": 0,
"full_lyrics": "…",
"vocal_gender": "m",
"variety": 1,
"persona_model": "style_persona",
},
"callback_url": "https://your-app.com/webhooks/nexus",
},
).json()
while task["status"] not in ("succeeded", "failed", "cancelled"):
time.sleep(3)
task = requests.get(f"{API}/tasks/{task['id']}", headers=HEADERS).json()
print(task["status"], task.get("output"))
const API = "https://nexus.promptscenes.in/api/v1";
const headers = {
Authorization: `Bearer ${process.env.NEXUS_API_KEY}`,
"Content-Type": "application/json",
};
let task = await fetch(`${API}/tasks`, {
method: "POST",
headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
body: JSON.stringify({
"model": "suno-replace-music-section",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"tags": "…",
"title": "…",
"infill_start_s": 0,
"infill_end_s": 0,
"full_lyrics": "…",
"vocal_gender": "m",
"variety": 1,
"persona_model": "style_persona"
},
"callback_url": "https://your-app.com/webhooks/nexus"
}),
}).then((r) => r.json());
while (!["succeeded", "failed", "cancelled"].includes(task.status)) {
await new Promise((r) => setTimeout(r, 3000));
task = await fetch(`${API}/tasks/${task.id}`, { headers }).then((r) => r.json());
}
console.log(task.status, task.output);
Request
{
"model": "suno-replace-music-section",
"input": {
"prompt": "A cinematic shot of a lighthouse at dawn",
"tags": "…",
"title": "…",
"infill_start_s": 0,
"infill_end_s": 0,
"full_lyrics": "…",
"vocal_gender": "m",
"variety": 1,
"persona_model": "style_persona"
}
}
Response
{
"id": "6f1c…",
"object": "task",
"model": "suno-replace-music-section",
"status": "succeeded",
"output": {
"files": [
{
"url": "https://…signed…",
"mime": "…",
"size": 0
}
]
},
"estimated_cost": "…",
"charged": "…"
}