tencent cloud

LLM Service TokenHub

Mureka Music Generation API Guide

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-10-28 17:28:40
AI翻訳

Overview

Mureka is an AI music generation model launched by Kunlun Wanwei, supporting the generation of complete songs and instrumental music based on lyrics, prompts, or styles. This document describes how to call the Mureka music generation model Mureka-Music-v9 (mureka-music-v9) through TokenHub, which provides three generation capabilities: song generation from lyrics, song generation from prompts, and instrumental music generation.

Call Methods

Music generation is a synchronous call: a single request directly returns the generated result without creating a task or polling.

Prerequisites

You have registered a Tencent Cloud account and activated the TokenHub service.
You have obtained an API Key from the TokenHub console.
Enable postpaid billing for the corresponding model in Console - Online Inference - Voice Models.
Note:
In all examples below, replace YOUR_API_KEY with your own API Key. The authentication method is the request header Authorization: Bearer YOUR_API_KEY.

Model list

Model Name
model Parameter Value
Supported Capability
Lyrics Limit
Prompt Limit
Mureka-Music-v9
mureka-music-v9
Lyric-based song generation / Prompt-based song generation / Instrumental music generation
5000 characters
Prompt-based song generation: 2000 characters; style prompts for lyric-based song generation and instrumental music prompts: 1024 characters
Attention:
The default value of the n parameter is 2 for all three capabilities, and billing is based on the number of generated songs. If you need only 1 song, explicitly pass "n": 1.

Generating Songs from Lyrics

1. API Description

Generate a song based on user-provided lyrics. Pass the complete lyrics, optionally with style prompts and vocal gender preference, and the model will compose and perform the song accordingly.
API: POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/mureka-music/generation

2. Input Parameters

Parameter Name
Required
Type
Description
model
Yes
string
Model ID. Value: mureka-music-v9
lyrics
Yes
string
Lyrics content, with a maximum length of 5000 characters.
Supports using section tags to organize song structure: [Intro], [Verse], [Pre-Chorus], [Chorus], [Bridge], [Outro].
prompt
No
string
Style prompt that controls the genre, mood, vocals, and other aspects (such as r&b, slow, passionate, male vocal), with a maximum length of 1024 characters.
gender
No
string
Vocal gender preference. Optional values: female, male.
n
No
integer
Number of songs generated per request, with a value range of [1, 3] and a default value of 2.

3. Request Example

# Generate a song from lyrics
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/mureka-music/generation' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"model": "mureka-music-v9",
"lyrics": "[Verse]\\nWalking through the city lights at midnight\\n[Chorus]\\nHold on to the memories",
"prompt": "pop, emotional, female vocal, slow tempo",
"gender": "female",
"n": 1
}'

4. Output Parameters

Field
Type
Description
id
string
Task ID.
created_at
integer
Task creation time, Unix timestamp, in seconds.
finished_at
integer
Task completion time, Unix timestamp, in seconds.
model
string
Model used for music generation.
status
string
Task status, enum values: preparing, queued, running, streaming, reviewing, succeeded, failed, timeouted, cancelled.
failed_reason
string
Reason for task failure. Returned when status is failed.
watermarked
boolean
Whether to add a 5-second watermark audio at the end of the music. true indicates that it is added.
choices
array[object]
List of generated results. Returned only when status is succeeded. The number of elements is consistent with the requested n.
choices[].url
string
Download URL of the generated audio. It is a temporary URL. Download and store it promptly.
tokenhub_usage.total_tokens
integer
Number of tokens consumed by this task, used for billing/reconciliation.
request_id
string
Unique request identifier, used for troubleshooting.

5. Response Example


{
"id": "1256342408-WandAudio-c6313c32b0b74c648f401571c515be00",
"created_at": 1790166087,
"finished_at": 1790166137,
"model": "mureka-9",
"status": "succeeded",
"choices": [
{
"url": "https://xxxx.mp3",
"flac_url": "https://xxxx.mp3",
"duration": 162630,
"lyrics_sections": [
{
"section_type": "verse",
"start": 12120,
"end": 20240,
"lines": [
{
"start": 12120,
"end": 20240,
"text": "Walking through the city lights at midnight",
"words": [
{
"start": 12120,
"end": 12200,
"text": "Walking "
},
{
"start": 13160,
"end": 13200,
"text": "through "
},
{
"start": 13800,
"end": 13840,
"text": "the "
},
{
"start": 14120,
"end": 14160,
"text": "city "
},
{
"start": 14560,
"end": 15560,
"text": "lights "
},
{
"start": 18640,
"end": 18680,
"text": "at "
},
{
"start": 19040,
"end": 20240,
"text": "midnight"
}
]
}
]
},
{
"section_type": "chorus",
"start": 38280,
"end": 76800,
"lines": [
{
"start": 38280,
"end": 76800,
"text": "Hold on to the memories",
"words": [
{
"start": 38280,
"end": 40520,
"text": "Hold "
},
{
"start": 40920,
"end": 40960,
"text": "on "
},
{
"start": 55920,
"end": 55960,
"text": "to "
},
{
"start": 71800,
"end": 71840,
"text": "the "
},
{
"start": 74320,
"end": 76800,
"text": "memories"
}
]
}
]
}
],
"id": "162503562821633",
"wav_url": "https://xxxx.mp3"
}
],
"trace_id": "4c0611edea3fc3493c82c3db7e71cb50",
"watermarked": true,
"tokenhub_usage": {
"total_tokens": 33000
},
"request_id": "1019e5dc-a80b-43b7-9122-6a325d01ca97"
}

Generating Songs from Prompts

1. API Description

Generate a song based on user-provided prompts, optionally with a style enum. You do not need to write lyrics yourself, as the model automatically completes lyric writing, composition, and singing.
API: POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/mureka-music/easy-generation

2. Input Parameters

Parameter Name
Required
Type
Description
model
Yes
string
Model ID. Value: mureka-music-v9
prompt
Yes
string
Prompt that describes the desired song content, mood, and visual imagery, with a maximum length of 2000 characters.
styles
No
array[string]
List of styles. Select one or more styles from the enumerated values:
pop,rock,jazz,r&b,edm,ambient,folk,latin,k-pop,j-pop,house,gospel,lo-fi.
n
No
integer
Number of songs generated per request, with a value range of [1, 3] and a default value of 2.

3. Request Example

# Generate a song from prompts
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/mureka-music/easy-generation' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"model": "mureka-music-v9",
"prompt": "A love song with a bright summer vibe and a catchy chorus",
"styles": ["pop", "rock"],
"n": 1
}'
The output parameters and response example of the submitted task are the same as those for lyric-based song generation.

Generating Instrumental Music

1. API Description

Generate instrumental music without vocals based on user-provided prompts, suitable for scenarios such as background music and accompaniment.
API: POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/mureka-music/instrumental-generation

2. Input Parameters

Parameter Name
Required
Type
Description
model
Yes
string
Model ID. Value: mureka-music-v9
prompt
Yes
string
Prompt that describes the desired instrumental music style and scene, with a maximum length of 1024 characters.
n
No
integer
Number of instrumental music pieces generated per request, with a value range of [1, 3] and a default value of 2.

3. Request Example

# Generate instrumental music
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/mureka-music/instrumental-generation' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"model": "mureka-music-v9",
"prompt": "lo-fi, cozy, warm piano and soft drums, late night study vibe",
"n": 1
}'

Appendix

Error Code Descriptions

Error Code
Overview
400 - Invalid Request
Cause: The request parameters are incorrect.
Solution: See the documentation to enter the correct request parameters.
401 - Invalid Authentication
Cause: The authentication is invalid.
Solution: Ensure that you use the correct API key.
403 - Forbidden
Cause: You are accessing the API from an unsupported region.
Solution: Ensure that your access originates from a supported region.
429 - Rate limit reached for requests
Cause: You are sending requests too quickly.
Solution: Control the request rate and check the concurrent request limit in the pricing plan.
429 - You exceeded your current quota, please check your billing details
Cause: Your prepaid balance has been used up.
Solution: Top up your account.
451 - Unavailable For Legal Reasons
Cause: The request parameters failed the security review.
Solution: Modify the request parameters.
500 - The server had an error while processing your request
Cause: A problem occurred with our service.
Solution: Retry your request later. If the issue persists, contact us.
503 - The engine is currently overloaded, please try again later
Cause: Our service is under heavy load.
Solution: Retry your request later.

FAQs

1. How to Distinguish the Three Generation Capabilities?

The model is the same for all three, but the API paths are different. Lyric-based song generation uses /v1/wand/mureka-music/generation, prompt-based song generation uses /v1/wand/mureka-music/easy-generation, and instrumental music generation uses /v1/wand/mureka-music/instrumental-generation. Note that the prompt length limits differ: 2000 characters for prompt-based song generation, and 1024 characters for both the style prompt in lyric-based song generation and the prompt in instrumental music generation.

2. Why Are Two Tracks Generated by Default?

The n parameter defaults to 2, and billing is based on the number of generated songs. If you need only 1 song, explicitly pass "n": 1 in the request. You can pass up to 3.

3. How to Write Better Lyrics?

It is recommended to organize the lyrics structure with section tags: [Intro] (intro), [Verse] (verse), [Pre-Chorus] (pre-chorus), [Chorus] (chorus), [Bridge] (bridge), and [Outro] (outro). You can also use prompt to supplement the genre, mood, and vocal description (for example, r&b, slow, passionate, male vocal), and use gender to specify the vocal gender preference.

4. What Is the Difference Between styles and Prompts?

styles is a fixed style enum (13 styles including pop, rock, and jazz) used to define the broad genre category, and it is supported only for prompt-based song generation. prompt is free-form text used to describe the song theme, mood, and visual imagery. Both can be passed together and take effect collectively in the model.

5. Do Generated Results Contain Watermarks?

A 5-second watermark audio is added to the end of the music by default. In the query result, watermarked being true indicates that it has been added.

6. Do Audio Links in Generated Results Expire?

It will expire. choices[].url is a temporary address stored for 12 hours. Download and save it promptly after the task succeeds, and do not reference this link over the long term.



ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック