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 true, the prompt is used as lyrics
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)

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