Music tools

    Generate full music tracks. All music jobs are asynchronous: call generate_music, then poll get_status until status is completed (or failed).

    For sound effects, an instrumental bed of an exact length, or a soundtrack written against a video you already have, use generate_sound below.


    #How to choose: simple vs advanced

    The generate_music tool supports two mutually exclusive modes. The agent should pick one based on what the user needs.

    Default to SIMPLE mode. Use ADVANCED only when the user explicitly provides or asks for lyrics, a title, style tags, or vocal gender.

    ModeWhen to use itHow the API decides
    SimpleQuick idea in one text: genre, mood, vibe, instruments. No fixed title, style tags, lyrics, or vocal gender.Do not set title or style (leave them empty). Provide a non-empty prompt (max 400 characters).
    Advanced (custom)User explicitly provides or asks for lyrics, a specific title, style tags, or vocal gender (or random). Needs either a song description or lyrics (not both), optional negative_tags (what to avoid).Set both title and style to non-empty strings. vocal_gender is required (m, f, or random). Supply exactly one of song_description or lyrics when not instrumental (see below).

    Rules:

    • If the user only describes a song idea (vibe, mood, genre, instruments) with no mention of lyrics/title/style → use simple mode.
    • If both title and style are non-empty → advanced mode (custom). prompt is ignored for content; use song_description / lyrics instead.
    • If either title or style is set alone → invalid; supply both or neither.
    • If neither title nor style is set → simple mode; prompt is required.

    Advanced mode — description vs lyrics (non-instrumental):

    • Choose one: set song_description or lyrics, never both. Sending both is rejected (they are not appended or merged).
    • Description path: theme/mood/instructions for the model to write the song; leave lyrics empty.
    • Lyrics path: user-supplied full lyrics; leave song_description empty.

    Advanced mode — instrumental: set instrumental: true and provide song_description only; do not pass lyrics.

    Use get_models with model_type=music for current model IDs and credit costs.


    #Models

    Music generation is powered by Suno. Supported model values (simple and advanced): V6, V6_WILD, V6_MINI (displayed in the app as V6, V6 Wild and V6 Mini). All three cost the same, so the choice is character, not price: V6 has the richest detail and the most natural vocals, V6_WILD pushes further for a bolder result, V6_MINI is the fast, light lane.

    If model is omitted, the platform default V6 applies. Every earlier version (V4, V4_5, V4_5PLUS, V4_5ALL, V5, V5_5) was discontinued by the provider. A request naming one is served by V6 at the same price rather than rejected, so an existing integration keeps working, but those ids are no longer part of the supported set.


    #generate_music

    #Simple mode parameters

    ParameterTypeRequiredDescription
    promptstringYesSingle description of the music; max 400 characters.
    instrumentalbooleanNoIf true, instrumental only (no vocals). Default: false.
    modelstringNoV6 (default), V6_WILD, or V6_MINI.

    Do not pass title, style, or vocal_gender for simple mode (leave empty).

    Example — simple, with vocals:

    {
      "prompt": "Upbeat pop song about summer",
      "instrumental": false,
      "model": "V6"
    }
    

    Example — simple, instrumental:

    {
      "prompt": "Epic orchestral background music",
      "instrumental": true
    }
    

    #Advanced mode parameters

    ParameterTypeRequiredDescription
    titlestringYesSong title; max 80 characters.
    stylestringYesStyle / genre / tags; max 1000 characters.
    vocal_genderstringYesm, f, or random (aliases: male/female; random lets the provider choose). For instrumental, still required by the API but vocal gender is not applied to vocals.
    song_descriptionstringXOR with lyricsWhat the song is about (theme, mood, instructions). Max 5000 chars. Omit if using lyrics.
    lyricsstringXOR with song_descriptionFull lyrics if the user supplied them. Max 5000 chars. Omit if using song_description.
    instrumentalbooleanNoDefault false. If true, require song_description only.
    negative_tagsstringNoStyles or elements to avoid; max 200 characters.
    style_weightnumberNoDefault 0.65 (same as web app).
    weirdness_constraintnumberNoDefault 0.65.
    audio_weightnumberNoDefault 0.65.
    modelstringNoSame set as simple mode.

    Content requirement (advanced, not instrumental): exactly one of song_description or lyrics must be non-empty (the other omitted or empty).

    Example — advanced with description only:

    {
      "title": "Neon Midnight",
      "style": "synthwave, 80s, driving bass, nostalgic",
      "vocal_gender": "random",
      "song_description": "A song about driving through the city at night with neon reflections",
      "model": "V6"
    }
    

    Example — advanced with lyrics only:

    {
      "title": "Morning Light",
      "style": "acoustic folk, gentle guitar, warm",
      "vocal_gender": "f",
      "lyrics": "[Verse 1] ... [Chorus] ..."
    }
    

    Response: Includes generation_id, status (e.g. pending), and often estimated_time_seconds. Poll with get_status.


    <a id="generate_sound"></a>

    #generate_sound

    Sound effects and music, either from a sentence or written against a clip you already have. Not for songs with vocals: that is generate_music. Every model here bills per second and generations cannot be refunded, so quote with estimate before you run it.

    Pick the model by what you have:

    ModelInputOutput
    sonilo-text-to-sfxA sentenceOne described sound effect. 1 to 180 seconds, default 5.
    sonilo-text-to-musicA sentenceAn instrumental track at the length you choose, never vocals. 5 to 360 seconds, default 60. Use it over Suno when the track has to fit a slot you already know.
    sonilo-video-to-sfxA videoEffects matched to the picture, as a bare audio track.
    sonilo-video-to-musicA videoA score written to the cut, as a bare audio track.
    sonilo-video-to-soundA videoEffects and a score mixed together, as a bare audio track.
    sonilo-video-to-video-sfxA videoSame as sonilo-video-to-sfx, but returns the clip with the sound in it.
    sonilo-video-to-video-musicA videoSame as sonilo-video-to-music, returned as the clip.
    sonilo-video-to-video-soundA videoSame as sonilo-video-to-sound, returned as the clip.

    Prefer a -video-to-video-* id when the user wants a finished clip back, and the bare audio ids when they will mix the sound themselves in an editor.

    Parameters:

    ParameterTypeRequiredDescription
    modelstringYesOne of the ids above.
    promptstringNoFolded into the field the model reads. The two *-sound models refuse a lone prompt; use music_prompt and sfx_prompt there. Max 2,000 characters.
    music_promptstringNoMood and instrumentation for the music part.
    sfx_promptstringNoWhat the effects should focus on.
    video_urlstringVideo modelsHTTPS URL of the clip, up to 360 seconds. For a local file, call get_upload_url(model_id="<the model id>"), let the user upload, then get_upload_session(token).
    duration_secondsnumberNoText models: the output length. Video models: the clip length, needed only when it is not already known from an upload or one of your own generations.
    preserve_speechbooleanNoVideo models. Keeps the speech already in the clip in the result. Default false.
    duckingbooleanNoVideo models, with preserve_speech on. Lowers the new sound while someone speaks. Default true.

    A video run with no prompt at all is valid, and often better: the model writes to what it sees.

    Billing: per second of the clip for video models (not of the output), and per second of output for the text models. Each product has a minimum billable length: 10 seconds on anything that writes music (both *-sound ids included) and 3 seconds on the effects-only ids, so a 6-second score bills 10 seconds. estimate(model=..., reference_video_seconds=<clip seconds>) applies the minimum for you.

    Response: {generation_id, status: "pending"}. Poll get_status until completed or failed. There is no provider callback, so the poll is also what settles the run; stop early and the credits stay reserved.


    #get_status

    Check the status of a music generation and get song URLs when done.

    Parameters:

    ParameterTypeRequiredDescription
    generation_idstringYesID returned from generate_music.

    Response: Includes status, progress, and when completed a songs array. Each song typically has id, title, audio_url, stream_url, cover_image_url, duration, lyrics, and style.

    See Limitations for rate limits and credits.