sonic

sample

Generate a complete song from a short audio sample or hummed melody. This endpoint uses a clip segment as inspiration to create a full-length track.

Credits cost: 20 on every model.

post/api/v1/sonic/sample

Request

  • Base URL
    https://api.musicapi.ai
  • URL
    https://api.musicapi.ai/api/v1/sonic/sample
  • Auth
    HTTP bearer

Request body

urlstring

URL of the audio file to use as sample. The API will automatically upload and obtain a clip ID. Mutually exclusive with sample_clip_id.

sample_clip_idstring

The clip ID of the sample audio (from a previous upload or platform song). Mutually exclusive with url.

chop_sample_start_snumber required

Start time of the sample segment in seconds. Must be >= 0.

chop_sample_end_snumber required

End time of the sample segment in seconds. Must be greater than chop_sample_start_s.

custom_modeboolean required

Set to true for custom lyrics mode (requires prompt), or false for AI description mode (requires gpt_description_prompt)

mv'sonic-v6' | 'sonic-v6-wild' | 'sonic-v6-mini' required

Music model version. Supports both sonic-* and chirp-* formats. Suno retired v3.5 through v5.5 on 2026-09-09 and maps every retired id onto v6, so sonic-v3-5, sonic-v4, sonic-v4-5, sonic-v4-5-plus, sonic-v5 and sonic-v5-5 are still accepted and run v6 — existing integrations need no change.

make_instrumentalboolean required

Set to true to generate instrumental music without vocals, or false to include vocals.

promptstring

Custom lyrics for the song. Required when custom_mode is true. Maximum 3000 characters.

gpt_description_promptstring

Description for AI to generate lyrics. Required when custom_mode is false. Maximum 200 characters.

titlestring

Song title. Maximum 80 characters.

tagsstring

Style tags (comma-separated). Examples: pop, rock, jazz, electronic. Maximum 200 characters.

negative_tagsstring

Tags to avoid in the generated music (comma-separated). Use this to exclude unwanted styles or elements.

style_weightnumber

Controls how strongly the style tags influence the output. Value between 0 and 1. Higher values = stronger style adherence.

weirdness_constraintnumber

Controls creativity/randomness level. Value between 0 and 1. Higher values = more experimental/unusual output.

audio_weightnumber

Audio weight parameter. Value between 0 and 1.

vocal_gender'f' | 'm'

Vocal gender: 'f' for female, 'm' for male. Supported on every current model.

auto_lyricsboolean

Automatically generate lyrics. When true, the prompt field is used as a song description to generate both lyrics and style.

webhook_urlstring

HTTPS URL to receive webhook notifications when the task completes. Must be a valid HTTPS URL.

webhook_secretstring

Secret key for webhook signature verification. Used to verify the webhook payload authenticity.

Response

success

codenumber required
messagestring required
task_idstring required

Changes

No recorded changes to this operation across all 1 revision of this API.