API 레퍼런스

음악

이 엔드포인트의 모델(1)

워크벤치에서 사용해 보기
POST/v1/music/generations
GET/v1/music/tasks/{task_id}
GET/v1/music/tasks/{task_id}/content

하나의 엔드포인트로 Suno 곡, 가사, 32개 도구. 호출하면 바로 task_id를 반환합니다. 완료될 때까지 작업을 폴링(또는 webhook)한 뒤 파일을 읽으세요.

#요청 파라미터

  • modelstring필수

    모델 페이지의 음악 모델 ID: suno.

  • operationstring선택

    할 일: music(기본값)은 곡을 만들고, lyrics는 가사를 쓰며, 아래 도구는 곡을 편집·연장·분석·내보냅니다.

  • promptstring선택

    영감 모드: 곡 내용, 최대 3000자. 맞춤 모드: 가사, 최대 5000자. 맞춤 모드 연주곡에는 필요 없음. lyrics의 경우: 가사 요청.

  • customboolean선택

    false(기본값): 영감 모드, prompt는 곡 설명. true: 맞춤 모드, prompt는 가사이며 title, style, negative_tags, auto_lyrics, persona_id, duration, max_mode가 적용됩니다.

  • instrumentalboolean선택

    true: 보컬 없음.

  • versionstring선택

    v6(기본값), v6-wild 또는 v6-mini. custom_model_id를 설정하면 생략하세요.

  • titlestring선택

    곡 제목, 최대 80자. 맞춤 모드.

  • stylestring선택

    장르, 분위기, 악기 같은 스타일 태그, 최대 1000자. 맞춤 모드. tags도 사용할 수 있습니다.

  • negative_tagsstring선택

    피할 스타일. 맞춤 모드.

  • vocal_genderstring선택

    Male(남성) 또는 Female(여성).

  • auto_lyricsboolean선택

    true: 주어진 가사를 창의적으로 다시 씁니다. 맞춤 모드.

  • style_weightnumber선택

    0~1: 곡이 스타일을 얼마나 따르는지. 0도 유효한 값입니다.

  • weirdness_constraintnumber선택

    0~1: 곡의 실험적인 정도.

  • audio_weightnumber선택

    0~1: 참조 녹음의 영향 정도.

  • varietystring선택

    off, normal, high, extra, max: 결과의 다양성.

  • max_modeboolean선택

    true: Max 모드, 더 높은 품질에 2배 가격. 맞춤 모드.

  • audio_formatstring선택

    mp3, m4a or wav.

  • durationinteger선택

    목표 길이(초), 10~360. 맞춤 모드. 완성된 곡은 다를 수 있습니다.

  • persona_idstring선택

    persona 도구로 만든 가수 Persona. 맞춤 모드. custom_model_id와 함께 쓸 수 없습니다.

  • custom_model_idstring선택

    create-model로 학습한 모델. version을 대체하며 persona_id와 함께 쓸 수 없습니다.

  • parametersobject선택

    도구 자체 필드(아래 「도구」 참조). 예: 다룰 곡의 task_id와 audio_index.

  • webhook_urlstring선택

    작업이 최종 상태에 도달하면 호출되는 HTTPS URL.

  • webhook_secretstring선택

    설정하면 전송에 X-Xiaoxiang-Signature: sha256=hex(HMAC-SHA256(body, secret))가 포함됩니다.

곡을 만드는 두 가지 방법

영감 모드(custom false): prompt에 곡을 설명하면 가사가 자동으로 작성됩니다. 맞춤 모드(custom true): prompt에 가사를 넣고 style, title 등으로 곡을 만듭니다. 먼저 prompt만으로 시작하세요.

#만든 곡 다루기

곡을 다루는 도구에는 task_id(이 API가 반환한, 곡을 만든 작업)와 audio_index(그 작업에서 곡의 순서: 첫 곡 1, 둘째 곡 2)를 전달합니다. 내가 완료한 Suno 작업만 사용할 수 있습니다.

내 녹음으로 시작하려면 upload로 가져오거나, audio_url을 바로 받는 upload-cover, upload-extend를 사용하세요. add-vocals, add-instrumental, sample은 가져온 녹음만 받습니다.

#도구

도구는 operation에, 필드는 parameters에 넣습니다. 필수 필드는 표시되어 있고 가격은 곡 1개 가격의 배수입니다.

Create

  • inspoInspiration references×1.36Max 모드 지원

    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 모드 지원

    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 모드 지원

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

    audio_url*customtagspromptinstrumental

  • upload-extendExtend your audio×1Max 모드 지원

    Upload audio and continue it from a chosen second.

    audio_url*continue_at*prompttags

  • add-vocalsAdd vocals×1Max 모드 지원

    Layer vocals onto your uploaded instrumental or song.

    task_id*audio_indexcustomprompttags

  • add-instrumentalAdd instrumental×1Max 모드 지원

    Layer an instrumental onto your uploaded vocals or song.

    task_id*audio_indextags

  • sampleSample to song×1Max 모드 지원

    Generate a new song from an existing song or sample.

    task_id*audio_indexstart_s*end_s*instrumentaltags

Edit a song

  • extendExtend song×1Max 모드 지원

    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 모드 지원

    Rearrange an existing song in a new musical style.

    task_id*audio_indextags

  • replaceReplace section×1Max 모드 지원

    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 모드 지원

    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.08사용 중단

    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

* 필수. 워크벤치의 「도구」에서 만든 곡에 대해 자동으로 채워집니다.

#가격

곡은 카탈로그 가격이며 요청마다 두 곡이 나옵니다. 도구는 그 가격에 배수를 곱한 값이며, 지원하는 도구는 max_mode로 2배가 됩니다. 견적과 선차감은 이 배수를 쓰고, 작업은 실제 비용으로 정산되며, 실패한 작업은 환불됩니다.

#결과

GET /v1/music/tasks/{task_id}는 언제든 응답합니다. GET /v1/music/tasks/{task_id}/content는 작업이 완료되면 첫 번째 곡의 오디오 파일을 반환합니다(그 전에는 400). 완료된 작업에 포함되는 항목:

  • url

    첫 번째 곡의 오디오.

  • assets

    작업이 만든 모든 파일: type(audio, video, image, midi, archive, file)과 url.

  • data.music

    곡별 audio_url(순서대로).

  • data.lyrics

    가사: text와 title.

  • data.result

    도구 자체 결과: music[](audio_id, title, lyrics, tags, duration, audio_url, image_url), persona_id, model_id, upsampled_tags, avg_bpm, files, videoUrl, alignment 등.

  • billing

    정산 후 작업 비용.

필요한 파일은 내려받으세요. 파일은 3일 동안 보관됩니다.

#관련 오류

  • 400 invalid_request작업에 필요한 필드가 없거나(task_id_required, continue_at_required …) 범위를 벗어났습니다(style_weight_out_of_range, duration_out_of_range, max_mode_requires_custom …). 요금은 부과되지 않습니다.
  • 400 source_task_not_foundtask_id가 내가 완료한 Suno 작업이 아닙니다. 아직 실행 중이면 source_task_not_ready입니다.
  • 410 media_expired작업 파일은 3일 후 삭제되었습니다. 작업이 끝나기 전에 /content를 읽으면 400을 반환합니다. 대신 작업을 폴링하세요.
  • 404 not_found알 수 없는 경로나 모델 이름, 또는 만료되었거나 다른 계정의 task_id입니다.
  • 401Bearer 토큰이 유효하지 않거나 없습니다. 이 경로에는 error.code가 없으므로 상태 코드로 판단하세요.
  • 402 insufficient_user_quota지갑 잔액이 사전 차감 추정액보다 부족합니다.
  • 429계정 요청 빈도 한도(기본 분당 모델 요청 500건). 간격을 두고 재시도하고, Retry-After가 있으면 그만큼 기다리세요. insufficient_user_quota가 담긴 429는 빈도 제한이 아니라 일일 사용 한도입니다.
  • 503 model_not_found알 수 없는 모델이거나, 현재 이 모델을 제공하는 정상 채널이 없습니다.

전체 오류 코드 표 →

#요청 예시

# 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.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": {"…": "…"}
}

아직 해결되지 않았나요?

요청 ID나 오류 메시지를 보내 주시면 확인해 드리겠습니다.