ApiframeDocs
Music Generation

Mureka

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

POST /v2/music/generatemodel: "mureka"

Generate full songs or instrumentals using Mureka. Provide your own lyrics, or just describe the song — lyrics are auto-generated from your prompt when you don't supply any.

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

Model-specific parameters

ParameterTypeDefaultDescription
murekaParams.model_versionstring"auto"Mureka model: "auto" (latest), "mureka-7.6", "mureka-o2", "mureka-8", "mureka-9"
murekaParams.lyricsstringSong lyrics (max 3,000 characters). When omitted, lyrics are auto-generated from prompt. Cannot be combined with instrumental: true
murekaParams.instrumentalbooleanfalseGenerate instrumental tracks (no vocals). Not supported by mureka-o2

For Mureka, prompt is a style description (genre, mood, vocals — e.g. "r&b, slow, passionate, male vocal") capped at 1,024 characters. It steers the music style and, when lyrics is omitted, is also used to write the lyrics.

Credit cost

VariantCredits
6

Each call returns two songs.

Example result

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

{
  "tracks": [
    {
      "id": "1436211-0",
      "audioUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-0.mp3",
      "imageUrl": null,
      "title": null,
      "tags": null,
      "duration": 154
    },
    {
      "id": "1436211-1",
      "audioUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-1.mp3",
      "imageUrl": null,
      "title": null,
      "tags": null,
      "duration": 162
    }
  ]
}

Mureka returns two tracks per request. Mureka does not return cover art or track titles, so imageUrl, title, and tags are null. See Result format for field details.

Code examples

Text-to-music (auto-generated 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": "r&b, slow, passionate, male vocal",
    "model": "mureka"
  }'
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": "r&b, slow, passionate, male vocal",
        "model": "mureka",
    },
)
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: "r&b, slow, passionate, male vocal",
    model: "mureka",
  }),
});
console.log(await response.json());
body := `{
  "prompt": "r&b, slow, passionate, male vocal",
  "model": "mureka"
}`
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": "jazz, pop, dreamy female vocal",
    "model": "mureka",
    "murekaParams": {
      "model_version": "mureka-9",
      "lyrics": "[Verse]\nIn the gentle evening air,\nWhispers dance without a care.\n[Chorus]\nHold me close, never let go"
    }
  }'

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": "mureka",
    "murekaParams": {
      "instrumental": true
    }
  }'

Try it

POST/v2/music/generateTry it

On this page