Skip to content

Generate Song

Mureka's song generation feature can create complete musical works including vocal performances and accompaniments. It supports multiple music styles, languages, and creation modes, providing precise control from simple prompts to complex music parameters.

API Information

  • Method: POST
  • Endpoint: /api/v1/music?action=song_generate
  • Function: Generate song

Authentication

BearerAuth Type: HTTP (bearer)

Request Body

json
{
  "lyrics": "string",
  "model": "string",
  "n": integer,
  "prompt": "string",
  "reference_id": "string",
  "vocal_id": "string",
  "melody_id": "string",
  "instrumental_id": "string"
}

Parameter Description

FieldTypeRequiredDescription
lyricsstringYesLyrics content (required)
modelstringNoModel version,options:auto,mureka-6,mureka-7.5,mureka-o1
nintNoNumber of songs to generate per request, maximum value is 3, default is 2
promptstringNoSong prompt
reference_idstringNoReference music ID, generated by files/upload API (purpose: reference)
vocal_idstringNoVocal ID, generated by files/upload API (purpose: vocal)
melody_idstringNoMelody ID, generated by files/upload API (purpose: melody)
instrumental_idstringNoInstrumental reference ID, generated by files/upload API (purpose: instrumental)

Response

json
{
  "code": 0,
  "message": "success",
  "resp_data": {
    "id": "task_1234567890abcdef",
    "created_at": 1640995200,
    "finished_at": 0,
    "model": "mureka-7.5",
    "status": "preparing",
    "failed_reason": "",
    "watermarked": false,
    "choices": []
  }
}

Request Examples

JSON Example

json
{
  "lyrics": "【Verse 1】\nYouth blooms like flowers\nDreams soar in the heart\n\n【Chorus】\nYouth and dreams\nForever in the heart",
  "model": "mureka-7.5",
  "n": 2,
  "prompt": "Create a pop song about youth and dreams"
}

cURL Example

bash
curl -X POST "[HOST]/api/v1/music?action=song_generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "lyrics": "【Verse 1】\nYouth blooms like flowers\nDreams soar in the heart\n\n【Chorus】\nYouth and dreams\nForever in the heart",
    "model": "mureka-7.5",
    "n": 2,
    "prompt": "Create a pop song about youth and dreams"
  }'