# Mureka 9.5 API Complete API reference for Mureka 9.5 music generation models. ## Model Variants | Model | Description | | ---------------------------- | --------------------------------------------------------------------------- | | `mureka-v9.5-generate-bgm` | Generate instrumental background music from a text description | | `mureka-v9.5-generate-song` | Generate a song from lyrics with optional style guidance and a cloned voice | | `mureka-v9.5-prompt-to-song` | Generate a complete song from a prompt and optional style tags | ## Endpoints ```text POST /api/v1/music/task GET /api/v1/music/{task_id} ``` ## Mureka 9.5 Generate Background Music ### Required Parameters | Parameter | Type | Description | | ------------ | ------ | ---------------------------------------------------------------------------------------------- | | `model_name` | string | Must be `mureka-v9.5-generate-bgm` | | `prompt` | string | Description of the background music, such as its style, mood, instruments, rhythm, or use case. Maximum 1024 characters | ### Optional Parameters | Parameter | Type | Description | | --------------- | ------ | ------------------------------------------------------------------ | | `output_format` | string | Generated audio format: `mp3`, `wav`, or `flac`. Defaults to `mp3` | ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/music/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'mureka-v9.5-generate-bgm', prompt: 'Warm acoustic guitar and soft piano background music for a relaxed travel video', output_format: 'mp3', }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Mureka 9.5 Generate Song ### Required Parameters | Parameter | Type | Description | | ------------ | ------ | ----------------------------------- | | `model_name` | string | Must be `mureka-v9.5-generate-song` | | `lyrics` | string | Lyrics for the song to generate. Maximum 5000 characters | ### Optional Parameters | Parameter | Type | Description | | --------------- | ------ | ------------------------------------------------------------------------------------------------------ | | `prompt` | string | Style guidance for the song, such as genre, mood, instruments, rhythm, vocals, or production direction. Maximum 1024 characters | | `output_format` | string | Generated audio format: `mp3`, `wav`, or `flac`. Defaults to `mp3` | | `vocal_id` | string | Existing Mureka voice ID for the desired vocal tone | ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/music/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'mureka-v9.5-generate-song', lyrics: 'We chase the morning light,\nAnd let the city fade away.', prompt: 'Uplifting indie pop with bright guitars, gentle drums, and a warm lead vocal', output_format: 'wav', vocal_id: 'YOUR_VOCAL_ID', }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Mureka 9.5 Prompt to Song ### Required Parameters | Parameter | Type | Description | | ------------ | ------ | ------------------------------------ | | `model_name` | string | Must be `mureka-v9.5-prompt-to-song` | ### Optional Parameters | Parameter | Type | Description | | --------------- | -------- | ------------------------------------------------------------------------------------------------------ | | `prompt` | string | Complete song description, including its theme, genre, mood, instruments, rhythm, or vocal direction. Maximum 2000 characters | | `styles` | string[] | Song style tags. Supported values: `pop`, `rock`, `jazz`, `r&b`, `edm`, `ambient`, `folk`, and `latin` | | `output_format` | string | Generated audio format: `mp3`, `wav`, or `flac`. Defaults to `mp3` | | `vocal_id` | string | Existing Mureka voice ID for the desired vocal tone | ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/music/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'mureka-v9.5-prompt-to-song', prompt: 'A dreamy late-night song about finding confidence after a difficult season', styles: ['ambient', 'pop'], output_format: 'flac', vocal_id: 'YOUR_VOCAL_ID', }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Response Format ### Task Submission ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/music/{task_id}", "task_status": "submitted" } } ``` ### Query Task Status ```javascript const response = await fetch('https://api.flaq.ai/api/v1/music/{task_id}', { headers: { Authorization: 'Bearer YOUR_API_KEY' }, }); const { data } = await response.json(); console.log(data.task_status); ``` ### Completed Task ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/music/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "audios": [{ "url": "https://example.com/generated-audio.mp3" }] } } } ``` ### Task Status Values - `submitted`: The task has been submitted. - `processing`: The task is being processed. - `succeed`: The task completed successfully. - `failed`: The task failed.