Search

Search HiAPI models, tools, and resources.

Back to blog
Tutorial5 min read

How to Use the Mureka 9.5 API: First Song in 5 Minutes

How the two routes differ, a 4-step browser trial, a 4-step API integration, runnable curl and Python, output format and four things to handle before launch.

HiAPI EditorialMureka 9.5API IntegrationTutorial

TL;DR

  • What it is: Mureka 9.5 is a music generation model with two routes on HiAPI. Lyrics-to-song takes complete lyrics and returns a finished vocal track with lead, harmonies and arrangement; instrumental takes one description and returns a vocal-free piece. Mureka 9.5 is live on HiAPI — open the lyrics-to-song model page to listen and generate in the browser, and new accounts get 200 free credits.
  • What it costs: $0.3215 (643 credits) per successful generation on either route. Lyric length and output length do not affect the price, and failed tasks are refunded. $10 covers about 31 songs.
  • Fastest path: paste lyrics on the model page, pick a vocal gender, hit run. For your own product, POST /v1/tasks with model: "mureka-9.5/lyrics-to-song", then poll the taskId for the audio URL.

What Mureka 9.5 does

The lyrics are finished; what's missing is the recording. The lyrics-to-song route collapses that gap into one request: put the complete lyrics in lyrics, add genre, mood, instruments, tempo and vocal character in the optional prompt, fix the lead as female or male with gender, and one mixed track comes back as MP3 at 44.1 kHz stereo, about 256 kbps.

Mureka 9.5 lyrics-to-song turns finished lyrics into a complete mixed song

The three real cases on the model page run 1:49, 3:02 and 3:30, all from this route at this price. It does not write lyrics for you and does not accept reference tracks or melodies; the inputs are lyrics plus a style direction.

The two routes side by side

Lyrics to songInstrumental
Model IDmureka-9.5/lyrics-to-songmureka-9.5/instrumental
Requiredlyrics (1–5,000 characters)prompt (1–1,024 characters)
Optionalprompt (1–2,000 characters), gender (female / male)—
OutputA complete sung songInstrumental music, no vocals
LengthDecided by the model from lyric structureDecided by the model; no duration parameter
Price$0.3215 per generation$0.3215 per generation

Vocals on the left, score on the right. Neither route takes a duration. The three instrumental cases on the model page run 3:12, 3:08 and 3:03.

Try it online in 4 steps

  1. Open the lyrics-to-song model page — the three real cases are playable there.
  2. Paste the full lyrics into the lyrics field, one line per line, with section tags like [Verse 1] and [Chorus].
  3. Fill in the style direction — genre, mood, instruments, vocal character — and set the lead to female or male.
  4. Hit run, then play and download the result. Each run is $0.3215.

For instrumental, replace step 2 with one instrumental description on the instrumental model page. Same four steps.

For a first run, start from this style direction:

Warm indie-pop song with a bright female lead vocal, chiming guitars, steady live drums and a wide sing-along chorus, hopeful late-night mood.

Generate with this prompt →

The link fills the style direction field. Paste four lines of your own lyrics into the lyrics field, set the lead to female, and run.

API in 4 steps

  1. Create an API key in the console after signing up.
  2. POST https://api.hiapi.ai/v1/tasks with model and input.
  3. Read data.taskId from the response, then poll GET /v1/tasks/{taskId} or wait for the callback.
  4. When the status is success, pull the entry with type=audio from data.output and download the MP3.

Lyrics to song: curl

curl -s -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mureka-9.5/lyrics-to-song",
    "input": {
      "lyrics": "[Verse 1]\nCity lights are waking up\nEvery window starts to glow\n[Chorus]\nWe keep moving through the night\nEvery shadow turns to gold",
      "prompt": "Warm indie-pop song with a bright female lead vocal, chiming guitars, steady live drums and a wide sing-along chorus, hopeful late-night mood.",
      "gender": "female"
    }
  }'

The task ID comes back in data.taskId:

{"code":200,"data":{"taskId":"tk-hiapi-..."},"message":"success"}

Instrumental: curl

curl -s -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mureka-9.5/instrumental",
    "input": {
      "prompt": "Cinematic orchestral instrumental with a fragile piano ostinato, evolving string swells, low brass and soft timpani, hopeful then resolute, wide film-score reverb."
    }
  }'

Check the status

curl -s https://api.hiapi.ai/v1/tasks/YOUR_TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

data.status moves through queued, handling, success or fail.

Python: submit, poll, download

import time
import requests

BASE = "https://api.hiapi.ai/v1/tasks"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

payload = {
    "model": "mureka-9.5/lyrics-to-song",
    "input": {
        "lyrics": "[Verse 1]\nCity lights are waking up\nEvery window starts to glow\n[Chorus]\nWe keep moving through the night\nEvery shadow turns to gold",
        "prompt": "Warm indie-pop song with a bright female lead vocal, chiming guitars, steady live drums and a wide sing-along chorus, hopeful late-night mood.",
        "gender": "female",
    },
}

resp = requests.post(BASE, headers=HEADERS, json=payload, timeout=30)
task_id = resp.json()["data"]["taskId"]

while True:
    data = requests.get(f"{BASE}/{task_id}", headers=HEADERS, timeout=30).json()["data"]
    if data["status"] in ("success", "fail"):
        break
    time.sleep(10)

if data["status"] == "success":
    audio_url = next(item["url"] for item in data["output"] if item["type"] == "audio")
    print(audio_url)
else:
    print(data.get("error"))

The instrumental route keeps the same polling loop and only changes the request, so it runs on its own too:

import time
import requests

BASE = "https://api.hiapi.ai/v1/tasks"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

payload = {
    "model": "mureka-9.5/instrumental",
    "input": {
        "prompt": "Cinematic orchestral instrumental with a fragile piano ostinato, evolving string swells, low brass and soft timpani, hopeful then resolute, wide film-score reverb.",
    },
}

task_id = requests.post(BASE, headers=HEADERS, json=payload, timeout=30).json()["data"]["taskId"]

while True:
    data = requests.get(f"{BASE}/{task_id}", headers=HEADERS, timeout=30).json()["data"]
    if data["status"] in ("success", "fail"):
        break
    time.sleep(10)

print(next((item["url"] for item in data.get("output", []) if item["type"] == "audio"), data.get("error")))

Output and format

Every request returns one MP3 at 44.1 kHz, stereo, about 256 kbps. Read it from the entry in data.output whose type is audio rather than looking for a bare string in the response.

The returned url expires, so copy the file into your own storage as soon as the task completes.

Before you ship

  1. Add a callback and a polling fallback. Include "callback": {"url": "https://yourapp.com/webhook", "when": "final"} in the request body to be notified at the terminal state — notifications can be missed, so also poll on a timer.
  2. Persist the taskId before retrying. Every task creation is a billable generation, and a client timeout does not mean the task failed. Store the taskId and check its status before submitting again.
  3. Break lyrics into lines. One line per line with section tags, verse and chorus in order, gives a much steadier structure. The cap is 5,000 characters.
  4. Set the vocal gender explicitly. When it's omitted, the model chooses. For a series or a brand track, fix female or male so the voice stays consistent across songs.

FAQ

Can lyrics be left empty for auto-writing? No. lyrics is required, 1–5,000 characters. Use a music model that supports automatic lyrics if you need that.

How long can one song be? There is no duration parameter; the model decides from the lyric structure. The vocal cases on the model page run 1:49, 3:02 and 3:30, the instrumentals 3:12, 3:08 and 3:03.

Will the instrumental route ever add vocals? No. It returns no sung vocals even if the description mentions a singer. Switch to lyrics-to-song when you need a voice.

Am I charged for a failed generation? No. The pre-charged amount is refunded automatically.

Run your first song now

Paste the curl above into a terminal, swap YOUR_API_KEY for your key and the lyrics for your own, and you'll have a taskId in a moment. To see the output first, open the lyrics-to-song model page and hit run. Full references: lyrics-to-song docs and instrumental docs.

Related: Mureka 9.5 pricing: $0.3215 per song · Mureka 9.5 vs MiniMax Music 2.6 · Mureka 9.5 prompts: 6 real examples

Generate it with HiAPI

Choose a model, enter your prompt, and see the result.

HiAPI Blog

Related articles

HiAPI

Generate it with HiAPI

Start generating