API reference

Music

Models on this endpoint (1)

Try it in the Workbench
POST/v1/music/generations
GET/v1/music/tasks/{task_id}
GET/v1/music/tasks/{task_id}/content

Suno 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

  • modelstringrequired

    The music model ID from the models page: suno.

  • operationstringoptional

    What to do: music (the default) makes a song, lyrics writes lyrics, and the tools below edit, extend, analyse or export a song.

  • promptstringoptional

    Inspiration 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.

  • custombooleanoptional

    false (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.

  • instrumentalbooleanoptional

    true: no vocals.

  • versionstringoptional

    v6 (the default), v6-wild or v6-mini. Leave it out when custom_model_id is set.

  • titlestringoptional

    Song title, up to 80 characters. Custom mode.

  • stylestringoptional

    Style tags such as genre, mood and instruments, up to 1000 characters. Custom mode. tags is accepted as well.

  • negative_tagsstringoptional

    Styles to avoid. Custom mode.

  • vocal_genderstringoptional

    Male or Female.

  • auto_lyricsbooleanoptional

    true: rewrite the given lyrics creatively. Custom mode.

  • style_weightnumberoptional

    0 to 1: how closely the song follows the style. 0 is a real value.

  • weirdness_constraintnumberoptional

    0 to 1: how adventurous the song is.

  • audio_weightnumberoptional

    0 to 1: how much a reference recording counts.

  • varietystringoptional

    off, normal, high, extra or max: how much the results vary.

  • max_modebooleanoptional

    true: Max mode, higher quality at twice the price. Custom mode.

  • audio_formatstringoptional

    mp3, m4a or wav.

  • durationintegeroptional

    Target length in seconds, 10 to 360. Custom mode; the finished song may differ.

  • persona_idstringoptional

    A singer persona made with the persona tool. Custom mode; not together with custom_model_id.

  • custom_model_idstringoptional

    A model trained with create-model. Replaces version; not together with persona_id.

  • parametersobjectoptional

    A tool’s own fields (see Tools below), for example task_id and audio_index of the song it works on.

  • webhook_urlstringoptional

    HTTPS URL called once the task reaches a terminal state.

  • webhook_secretstringoptional

    If set, deliveries carry X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret)).

Two ways to write a song

Inspiration mode (custom false): describe the song in prompt and the lyrics are written for you. Custom mode (custom true): prompt holds your lyrics, and style, title and the other custom fields shape the song. Start with prompt alone.

#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 available

    Generate a new song from 1–4 public audio references.

    audio_urls*tags

  • soundsSound effects×0.192

    Generate a sound effect from a text description.

    prompt*type

  • upsample-tagsEnhance style tags×0.08

    Expand and refine music style tags.

    tags*

  • mashupMashup×1Max mode available

    Create a mashup from exactly two platform tasks.

    task_ids*audio_indexestags

Start from your own audio

  • uploadImport audio×0.08

    Import external audio for use in later studio operations.

    audioFilePath*

  • upload-coverCover your audio×1Max mode available

    Upload audio and remake it in a new style in one step.

    audio_url*customtagspromptinstrumental

  • upload-extendExtend your audio×1Max mode available

    Upload audio and continue it from a chosen second.

    audio_url*continue_at*prompttags

  • add-vocalsAdd vocals×1Max mode available

    Layer vocals onto your uploaded instrumental or song.

    task_id*audio_indexcustomprompttags

  • add-instrumentalAdd instrumental×1Max mode available

    Layer an instrumental onto your uploaded vocals or song.

    task_id*audio_indextags

  • sampleSample to song×1Max mode available

    Generate a new song from an existing song or sample.

    task_id*audio_indexstart_s*end_s*instrumentaltags

Edit a song

  • extendExtend song×1Max mode available

    Continue and extend an existing song from a specified time.

    task_id*audio_indexcontinue_at*prompttags

  • concatAssemble full song×0.08

    Assemble existing segments into a complete song.

    task_id*audio_index

  • coverStyle cover×1Max mode available

    Rearrange an existing song in a new musical style.

    task_id*audio_indextags

  • replaceReplace section×1Max mode available

    Regenerate the music within a specified time range.

    task_id*audio_indexstart_s*end_s*infill_lyrics

  • remove-sectionRemove section×0.16

    Remove a specified time range from a song.

    task_id*audio_indexstart_s*end_s*

  • cropCrop audio×0.16

    Keep only the specified time range.

    task_id*audio_indexstart_s*end_s*

  • fade-inFade in×0.16

    Add a fade-in effect to the beginning of a song.

    task_id*audio_indexduration_s*

  • fade-outFade out×0.16

    Add a fade-out effect to the end of a song.

    task_id*audio_indexduration_s*

  • adjust-speedAdjust speed×0.48

    Change playback speed without changing pitch.

    task_id*audio_indexspeed*keep_pitch

  • remasterRemaster×1

    Improve the clarity, loudness, and overall texture of a song.

    task_id*audio_indexvariation_category

  • add-stemAdd a stem×1Max mode available

    Layer a new stem onto an existing song.

    task_id*audio_indextags

Stems, voices and models

  • stemsExtract a stem×2

    Extract a selected stem from a song.

    task_id*audio_indexstem_type

  • stems-allSeparate all stems×4.8

    Separate every available stem in a song.

    task_id*audio_index

  • personaCreate Persona×0.08

    Create a singer Persona from a song or Vox result.

    task_id*audio_indexname*describestyles

  • create-voiceCreate voice×0.32

    Create a reusable voice from a public audio URL.

    audio_url*

  • create-modelTrain a custom model×19.2

    Train 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.08Deprecated

    Deprecated: make a Persona straight from a song instead.

    task_id*audio_indexvocal_start_svocal_end_s

Export and analyse

  • downloadDownload audio×0.032

    Get a song as MP3, M4A or WAV files.

    task_id*audio_indexformats

  • generate-mp4Generate music video×0.08

    Render a song as an MP4 music video.

    task_id*audio_index

  • midiGenerate MIDI×1

    Convert a song into a MIDI result.

    task_id*audio_index

  • aligned-lyricsLyrics timeline×0.016

    Generate a line-aligned lyrics timeline.

    task_id*audio_index

  • bpmAnalyze BPM×0.016

    Analyze 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:

  • url

    The first song’s audio.

  • assets

    Every file the task made: type (audio, video, image, midi, archive or file) and url.

  • data.music

    The songs’ audio_url, in order.

  • data.lyrics

    The lyrics: text and title.

  • data.result

    The 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.

  • billing

    What 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.

Full error-code table →

#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

response.json
// 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.