POST /v2/generate

Generate music using AI. Supports both inspiration mode (text description) and custom mode (lyrics, style, title).

POSThttps://udioapi.pro/api/v2/generate

tips

Two Generation Modes:

  • Inspiration Mode: Use gpt_description_prompt to generate music from a text description
  • Custom Mode: Use prompt, style, and title for detailed control

Model Selection: Choose from chirp-v4-0, chirp-v4-5, or chirp-v4-5-plus, chirp-v5 for different quality levels.

requestHeaders

namerequireddescription
AuthorizationYesBearer token for authentication
Content-TypeYesapplication/json

Request Body

Request body supports two modes: Inspiration Mode or Custom Mode

Inspiration Mode

Generate music from a text description

Parameter Type Required Description Example
gpt_description_promptstringYesText description of the music you want to generate. Max length: 400 chars for chirp-v3-5/chirp-v4-0A upbeat pop song about summer vacation with catchy melody
Custom Mode

Generate music with custom lyrics, style, and title

Parameter Type Required Description Example
promptstringYesCustom lyrics or detailed prompt. Max length: 3000 chars (chirp-v3-5/chirp-v4-0) or 5000 chars (chirp-v4-5/chirp-v4-5-plus)Verse 1: Walking down the street, feeling so free...
stylestringNoMusical style/genre. Max length: 200 chars (chirp-v3-5/chirp-v4-0) or 1000 chars (chirp-v4-5/chirp-v4-5-plus/chirp-v5)pop, upbeat, electronic, 120 bpm
titlestringNoSong title. Max length: 80 charactersSummer Dreams
tagsstringNoNegative tags to avoid in generationsad, slow
Common Parameters
Parameter Type Required Description Example
modelstringNoAI model to use. Options: 'chirp-v3-5' (default), 'chirp-v4-0', 'chirp-v4-5', 'chirp-v4-5-plus', 'chirp-v5'.chirp-v5
make_instrumentalbooleanNoGenerate instrumental music without vocalsfalse
genderstringNoVocal gender preference. Use 'male' or 'female'female
style_weightnumberNoStrength of adherence to style. Range 0–1, up to 2 decimals0.65
weirdness_constraintnumberNoControls creative deviation. Range 0–1, up to 2 decimals0.65
audio_weightnumberNoBalance weight for audio features. Range 0–1, up to 2 decimals0.65

responses

{
  "code": 200,
  "message": "success",
  "workId": "gen2abc123def456bksv",
  "data": {
    "task_id": "gen2abc123def456bksv"
  }
}
{
  "code": 400,
  "message": "No body provided"
}
{
  "code": 401,
  "message": "No API key provided in Authorization header"
}
{
  "code": 500,
  "message": "Internal Server Error",
  "data": {
    "task_id": "gen2abc123def456bksv"
  },
  "workId": "gen2abc123def456bksv"
}

codeExamples

curl -X POST "https://udioapi.pro/api/v2/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "chirp-v4-5",
    "gpt_description_prompt": "A upbeat pop song about summer vacation with catchy melody",
    "make_instrumental": false,
    "gender": "female",
    "style_weight": 0.65,
    "weirdness_constraint": 0.65,
    "audio_weight": 0.65
  }'
curl -X POST "https://udioapi.pro/api/v2/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "chirp-v4-5",
    "prompt": "Verse 1: Walking down the street, feeling so free\nChorus: Summer dreams are calling me",
    "style": "pop, upbeat, electronic, 120 bpm",
    "title": "Summer Dreams",
    "make_instrumental": false,
    "gender": "female",
    "style_weight": 0.65,
    "weirdness_constraint": 0.65,
    "audio_weight": 0.65
  }'
const response = await fetch('https://udioapi.pro/api/v2/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'chirp-v4-5',
    gpt_description_prompt: 'A upbeat pop song about summer vacation with catchy melody',
    make_instrumental: false,
    gender: 'female',
    style_weight: 0.65,
    weirdness_constraint: 0.65,
    audio_weight: 0.65
  })
});

const data = await response.json();
console.log(data);
const response = await fetch('https://udioapi.pro/api/v2/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'chirp-v4-5',
    prompt: 'Verse 1: Walking down the street, feeling so free\nChorus: Summer dreams are calling me',
    style: 'pop, upbeat, electronic, 120 bpm',
    title: 'Summer Dreams',
    make_instrumental: false,
    gender: 'female',
    style_weight: 0.65,
    weirdness_constraint: 0.65,
    audio_weight: 0.65
  })
});

const data = await response.json();
console.log(data);
import requests

url = "https://udioapi.pro/api/v2/generate"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "model": "chirp-v4-5",
    "gpt_description_prompt": "A upbeat pop song about summer vacation with catchy melody",
    "make_instrumental": False,
    "gender": "female",
    "style_weight": 0.65,
    "weirdness_constraint": 0.65,
    "audio_weight": 0.65
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
import requests

url = "https://udioapi.pro/api/v2/generate"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "model": "chirp-v4-5",
    "prompt": "Verse 1: Walking down the street, feeling so free\nChorus: Summer dreams are calling me",
    "style": "pop, upbeat, electronic, 120 bpm",
    "title": "Summer Dreams",
    "make_instrumental": False,
    "gender": "female",
    "style_weight": 0.65,
    "weirdness_constraint": 0.65,
    "audio_weight": 0.65
}

response = requests.post(url, headers=headers, json=data)
print(response.json())