ApiframeApiframe Docs
Music Generation

Suno

Text-to-music and lyrics-to-music generation using Suno.

Use in Apiframe Studio

POST /v2/music/generatemodel: "suno"

Generate music tracks from text descriptions or custom lyrics.

See Music Generation overview for common request fields, response format, and error codes.

Model-specific parameters

ParameterTypeDefaultDescription
sunoParams.custom_modebooleanfalseWhen false, the prompt is a song description (max 500 chars). When true, the prompt is used as lyrics (max 5,000 chars).
sunoParams.instrumentalbooleanfalseGenerate instrumental only (no vocals)
sunoParams.model_versionstring"V4_5PLUS"Suno model version: "V4", "V4_5", "V4_5ALL", "V4_5PLUS", "V5", "V5_5"
sunoParams.titlestringTrack title (max 80 characters)
sunoParams.stylestringMusic style description (max 1,000 characters)
sunoParams.negative_tagsstringStyles to avoid (max 500 characters)
sunoParams.vocal_genderstringVocal gender: "m" (male) or "f" (female)
sunoParams.style_weightnumberStyle adherence weight (0.0–1.0)
sunoParams.weirdness_constraintnumberCreativity/randomness level (0.0–1.0)
sunoParams.auto_lyricsbooleanAuto-generate lyrics from the prompt (custom mode only)

Prompt length depends on custom_mode. With custom_mode: false (the default), Suno treats the prompt as a short description and rejects anything over 500 characters. If you have a longer prompt — e.g. full lyrics — set custom_mode: true. Requests that violate this cap fail validation with 400 before any provider is called.

Credit cost

VariantCredits
11
extend11
cover11
add_vocals11
stems11

The extend, cover, add_vocals, and stems rows apply to follow-up actions on a completed generation.

Example result

Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:

{
  "tracks": [
    {
      "id": "8b2f64d1-3c5e-4a7f-9d2b-6e1a0c4f8b3d",
      "audioUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-0.mp3",
      "imageUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-0.jpeg",
      "title": "Neon Skyline",
      "tags": "synthwave, electronic, upbeat",
      "duration": 184.2
    },
    {
      "id": "f4a1c9e7-6b2d-4e8a-a3f5-0d7c2b9e1a64",
      "audioUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-1.mp3",
      "imageUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-1.jpeg",
      "title": "Neon Skyline",
      "tags": "synthwave, electronic, upbeat",
      "duration": 178.6
    }
  ]
}

Suno generates 2 tracks per request. See Result format for field details.

Follow-up actions

Once a generation is COMPLETED, either of its 2 tracks can be acted on:

  • Extend — continue the track from a chosen timestamp, equivalent to Suno's Extend button.
  • Cover — re-generate the track in a new style while keeping its core melody.
  • Add Vocals — layer AI-generated vocals onto the track (intended for instrumental generations).
  • Stems — split the track into separate vocals and instrumental files.

Extend, cover, and add-vocals results are real Suno generations, so they can be acted on again — longer songs can be built up in segments. Stems results are plain audio files and accept no further actions.

Code examples

Text-to-music (description mode)

curl -X POST https://api.apiframe.ai/v2/music/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "upbeat electronic track with synth arpeggios and driving bass",
    "model": "suno",
    "sunoParams": {
      "model_version": "V4_5PLUS",
      "style": "electronic, synthwave"
    }
  }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/music/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "upbeat electronic track with synth arpeggios and driving bass",
        "model": "suno",
        "sunoParams": {
            "model_version": "V4_5PLUS",
            "style": "electronic, synthwave",
        },
    },
)
print(response.json())
const response = await fetch("https://api.apiframe.ai/v2/music/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "upbeat electronic track with synth arpeggios and driving bass",
    model: "suno",
    sunoParams: {
      model_version: "V4_5PLUS",
      style: "electronic, synthwave",
    },
  }),
});
console.log(await response.json());
body := `{
  "prompt": "upbeat electronic track with synth arpeggios and driving bass",
  "model": "suno",
  "sunoParams": {"model_version": "V4_5PLUS", "style": "electronic, synthwave"}
}`
req, _ := http.NewRequest("POST", "https://api.apiframe.ai/v2/music/generate",
    strings.NewReader(body))
req.Header.Set("X-API-Key", "afk_your_api_key_here")
req.Header.Set("Content-Type", "application/json")

resp, err := http.DefaultClient.Do(req)

Custom mode (lyrics)

curl -X POST https://api.apiframe.ai/v2/music/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "[Verse 1]\nWalking through the city lights\nNeon glow on rainy nights\n\n[Chorus]\nWe are the dreamers, we are the stars",
    "model": "suno",
    "sunoParams": {
      "custom_mode": true,
      "title": "City Dreamers",
      "style": "pop, indie",
      "vocal_gender": "f"
    }
  }'

Try it

POST/v2/music/generateTry it

On this page