ApiframeApiframe Docs
Music Generation

Mureka

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

Use in Apiframe Studio

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
murekaParams.ninteger2Number of songs to generate (1–3). Billed per song

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

Mureka is billed per song — 6 credits each, based on murekaParams.n:

VariantSongsCredits
n11 song6
n22 songs (default)12
n33 songs18

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 one track per requested song (n, default 2). 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