API reference
Music
Models on this endpoint (1)
/v1/music/generations/v1/music/tasks/{task_id}/v1/music/tasks/{task_id}/contentSuno songs, lyrics and 32 tools through one endpoint. Every call returns a task_id at once; poll the task, or take a webhook, until it is completed, then read its files.
#Request parameters
modelstringrequiredThe music model ID from the models page: suno.
operationstringoptionalWhat to do: music (the default) makes a song, lyrics writes lyrics, and the tools below edit, extend, analyse or export a song.
promptstringoptionalInspiration mode: what the song is about, up to 3000 characters. Custom mode: the lyrics, up to 5000. Not needed for a custom-mode instrumental. For lyrics: the brief.
custombooleanoptionalfalse (the default): inspiration mode, prompt describes the song. true: custom mode, prompt is the lyrics, and title, style, negative_tags, auto_lyrics, persona_id, duration and max_mode apply.
instrumentalbooleanoptionaltrue: no vocals.
versionstringoptionalv6 (the default), v6-wild or v6-mini. Leave it out when custom_model_id is set.
titlestringoptionalSong title, up to 80 characters. Custom mode.
stylestringoptionalStyle tags such as genre, mood and instruments, up to 1000 characters. Custom mode. tags is accepted as well.
negative_tagsstringoptionalStyles to avoid. Custom mode.
vocal_genderstringoptionalMale or Female.
auto_lyricsbooleanoptionaltrue: rewrite the given lyrics creatively. Custom mode.
style_weightnumberoptional0 to 1: how closely the song follows the style. 0 is a real value.
weirdness_constraintnumberoptional0 to 1: how adventurous the song is.
audio_weightnumberoptional0 to 1: how much a reference recording counts.
varietystringoptionaloff, normal, high, extra or max: how much the results vary.
max_modebooleanoptionaltrue: Max mode, higher quality at twice the price. Custom mode.
audio_formatstringoptionalmp3, m4a or wav.
durationintegeroptionalTarget length in seconds, 10 to 360. Custom mode; the finished song may differ.
persona_idstringoptionalA singer persona made with the persona tool. Custom mode; not together with custom_model_id.
custom_model_idstringoptionalA model trained with create-model. Replaces version; not together with persona_id.
parametersobjectoptionalA tool’s own fields (see Tools below), for example task_id and audio_index of the song it works on.
webhook_urlstringoptionalHTTPS URL called once the task reaches a terminal state.
webhook_secretstringoptionalIf set, deliveries carry X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret)).
Two ways to write a song
#Working on a song you made
A tool that works on a song takes task_id, the task that made it as this API returned it, and audio_index, the song’s place in that task: 1 for the first, 2 for the second. Only your own finished Suno tasks can be used.
To start from your own recording, import it with upload, or use upload-cover and upload-extend, which take an audio_url directly. add-vocals, add-instrumental and sample only take an imported recording.
#Tools
Send the tool as operation and its fields in parameters. Required fields are marked; the price is a multiple of one song.
Create
inspoInspiration references×1.36Max mode availableGenerate a new song from 1–4 public audio references.
audio_urls*tags
soundsSound effects×0.192Generate a sound effect from a text description.
prompt*type
mashupMashup×1Max mode availableCreate a mashup from exactly two platform tasks.
task_ids*audio_indexestags
Start from your own audio
uploadImport audio×0.08Import external audio for use in later studio operations.
audioFilePath*
upload-coverCover your audio×1Max mode availableUpload audio and remake it in a new style in one step.
audio_url*customtagspromptinstrumental
upload-extendExtend your audio×1Max mode availableUpload audio and continue it from a chosen second.
audio_url*continue_at*prompttags
add-vocalsAdd vocals×1Max mode availableLayer vocals onto your uploaded instrumental or song.
task_id*audio_indexcustomprompttags
add-instrumentalAdd instrumental×1Max mode availableLayer an instrumental onto your uploaded vocals or song.
task_id*audio_indextags
sampleSample to song×1Max mode availableGenerate a new song from an existing song or sample.
task_id*audio_indexstart_s*end_s*instrumentaltags
Edit a song
extendExtend song×1Max mode availableContinue and extend an existing song from a specified time.
task_id*audio_indexcontinue_at*prompttags
concatAssemble full song×0.08Assemble existing segments into a complete song.
task_id*audio_index
coverStyle cover×1Max mode availableRearrange an existing song in a new musical style.
task_id*audio_indextags
replaceReplace section×1Max mode availableRegenerate the music within a specified time range.
task_id*audio_indexstart_s*end_s*infill_lyrics
remove-sectionRemove section×0.16Remove a specified time range from a song.
task_id*audio_indexstart_s*end_s*
cropCrop audio×0.16Keep only the specified time range.
task_id*audio_indexstart_s*end_s*
fade-inFade in×0.16Add a fade-in effect to the beginning of a song.
task_id*audio_indexduration_s*
fade-outFade out×0.16Add a fade-out effect to the end of a song.
task_id*audio_indexduration_s*
adjust-speedAdjust speed×0.48Change playback speed without changing pitch.
task_id*audio_indexspeed*keep_pitch
remasterRemaster×1Improve the clarity, loudness, and overall texture of a song.
task_id*audio_indexvariation_category
add-stemAdd a stem×1Max mode availableLayer a new stem onto an existing song.
task_id*audio_indextags
Stems, voices and models
stemsExtract a stem×2Extract a selected stem from a song.
task_id*audio_indexstem_type
stems-allSeparate all stems×4.8Separate every available stem in a song.
task_id*audio_index
personaCreate Persona×0.08Create a singer Persona from a song or Vox result.
task_id*audio_indexname*describestyles
create-voiceCreate voice×0.32Create a reusable voice from a public audio URL.
audio_url*
create-modelTrain a custom model×19.2Train a model on 6–24 of your own tracks, then use it as custom_model_id. Training can take about 20 minutes.
name*audio_urls*
voxExtract Vox×0.08DeprecatedDeprecated: make a Persona straight from a song instead.
task_id*audio_indexvocal_start_svocal_end_s
Export and analyse
downloadDownload audio×0.032Get a song as MP3, M4A or WAV files.
task_id*audio_indexformats
generate-mp4Generate music video×0.08Render a song as an MP4 music video.
task_id*audio_index
midiGenerate MIDI×1Convert a song into a MIDI result.
task_id*audio_index
aligned-lyricsLyrics timeline×0.016Generate a line-aligned lyrics timeline.
task_id*audio_index
bpmAnalyze BPM×0.016Analyze the tempo of a song.
task_id*audio_index
* required. The workbench’s Tools tab fills these in for a song you made.
#Price
A song costs the catalogue price; each request returns two songs. A tool costs that price times its multiple, and max_mode doubles the tools that offer it. The quote and the hold use these multiples, the task is settled on its actual cost, and a failed task is refunded.
#Result
GET /v1/music/tasks/{task_id} answers at any time; GET /v1/music/tasks/{task_id}/content returns the first song’s audio file once the task is completed (400 before). A finished task carries:
urlThe first song’s audio.
assetsEvery file the task made: type (audio, video, image, midi, archive or file) and url.
data.musicThe songs’ audio_url, in order.
data.lyricsThe lyrics: text and title.
data.resultThe tool’s own result: music[] (audio_id, title, lyrics, tags, duration, audio_url, image_url), persona_id, model_id, upsampled_tags, avg_bpm, files, videoUrl, alignment and so on.
billingWhat the task cost, once it is settled.
Download the files you need: they are kept for 3 days.
#Related errors
- 400 invalid_requestA field the operation needs is missing (task_id_required, continue_at_required …) or out of range (style_weight_out_of_range, duration_out_of_range, max_mode_requires_custom …). Nothing is charged.
- 400 source_task_not_foundtask_id is not one of your finished Suno tasks; source_task_not_ready while it is still running.
- 410 media_expiredThe task’s files were deleted after 3 days. /content read before the task finished answers 400: poll the task instead.
- 404 not_foundUnknown path, unknown model name, or an expired / foreign task_id.
- 401Invalid or missing bearer token. No error.code on this path — match the status.
- 402 insufficient_user_quotaWallet balance cannot cover the pre-reserved estimate.
- 429Account request rate limit (500 model requests per minute by default). Back off and retry, waiting for Retry-After when it is sent. A 429 that carries insufficient_user_quota is a daily spend cap instead.
- 503 model_not_foundUnknown model, or no healthy channel serves it right now.
#Request example
# a song: describe it
curl https://apiking.ai/v1/music/generations \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "suno", "prompt": "a warm cinematic piano theme", "instrumental": true}'
# or write the lyrics yourself
curl https://apiking.ai/v1/music/generations \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "suno", "custom": true, "title": "Neon Rain",
"prompt": "[Verse]\nCity lights in the rain\n[Chorus]\nWe run till dawn",
"style": "synthwave, female vocal"}'
# poll every 5s until completed
curl https://apiking.ai/v1/music/tasks/$TASK_ID -H "Authorization: Bearer sk-YOUR_KEY"
# a tool on the second song: extend it from 0:60
curl https://apiking.ai/v1/music/generations \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "suno", "operation": "extend",
"parameters": {"task_id": "'$TASK_ID'", "audio_index": 2, "continue_at": 60}}'#Response
// POST — submit accepted
{"id": "task_xxx", "task_id": "task_xxx", "object": "music.task", "model": "suno", "status": "queued"}
// GET /v1/music/tasks/{task_id}
{
"task_id": "task_xxx",
"object": "music.task",
"operation": "music",
"status": "completed",
"progress": "100%",
"url": "https://…/audio/task_xxx",
"assets": [
{"type": "audio", "url": "https://…"},
{"type": "audio", "url": "https://…"},
{"type": "image", "url": "https://…"}
],
"data": {
"music": [{"audio_url": "https://…"}],
"lyrics": {"title": "Neon Rain", "text": "[Verse] …"},
"result": {"music": [{"audio_id": "…", "title": "Neon Rain", "duration": 182.4, "audio_url": "https://…", "image_url": "https://…"}]}
},
"billing": {"…": "…"}
}Still stuck?
Send us the request ID or the error message and we will look into it.