Music Generation
Udio
Text-to-music and lyrics-to-music generation using Udio.
POST /v2/music/generate — model: "udio"
Generate music tracks from text descriptions or custom lyrics using Udio.
See Music Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
udioParams.lyrics_type | string | "generate" | Generation mode: "generate" (AI writes lyrics from description), "user" (you provide lyrics), "instrumental" (no vocals) |
udioParams.title | string | — | Track title (max 80 characters) |
udioParams.style | string | — | Music style / genre hint (max 1,000 characters). Used as the style description when lyrics_type is "user" |
udioParams.negative_tags | string | — | Styles to avoid, comma-separated (max 500 characters) |
udioParams.seed | integer | — | Seed for reproducibility |
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": "chill lo-fi hip hop beat with jazzy piano chords and vinyl crackle",
"model": "udio",
"udioParams": {
"lyrics_type": "generate"
}
}'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": "chill lo-fi hip hop beat with jazzy piano chords and vinyl crackle",
"model": "udio",
"udioParams": {
"lyrics_type": "generate",
},
},
)
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: "chill lo-fi hip hop beat with jazzy piano chords and vinyl crackle",
model: "udio",
udioParams: {
lyrics_type: "generate",
},
}),
});
console.log(await response.json());body := `{
"prompt": "chill lo-fi hip hop beat with jazzy piano chords and vinyl crackle",
"model": "udio",
"udioParams": {"lyrics_type": "generate"}
}`
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 lyrics 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": "[Verse]\nIn the gentle evening air,\nWhispers dance without a care.\nStars ignite our dreams above,\nWrapped in warmth, we find our love.\n[Chorus]\nHold me close, never let go",
"model": "udio",
"udioParams": {
"lyrics_type": "user",
"style": "jazz, pop",
"title": "Evening Stars"
}
}'Instrumental 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": "ambient electronic soundscape with evolving pads and gentle arpeggios",
"model": "udio",
"udioParams": {
"lyrics_type": "instrumental",
"negative_tags": "vocals, singing"
}
}'Try it
POST
/v2/music/generateTry it