Basic Information
- Base URL:
https://mm-internal-cn.leonecloud.com - Authentication:
Authorization: Bearer <API_KEY> - Content-Type:
application/json - Route Prefix:
/api/v2/open/aigc/mureka
with Mureka endpointRoute Prefix, Path and Request Bodyfield:in Mureka Path first Route Prefix can (localized example text/v1/song/generate → /api/v2/open/aigc/mureka/v1/song/generate).Request Body, Query Parametersfield, OptionalParameter; JSON.
: with Mureka SDK /, baseUrl ashttps://mm-internal-cn.leonecloud.com/api/v2/open/aigc/mureka, as API Key, Path and Parameter.endpointCapabilityendpoint as, and query Method:
-synchronous endpoint:Requestreturned when applicable, no Polling (,,,,,, ).
- endpoint:Requestreturn taskid, query endpointPolling (, music,,,,,,,, video).
- endpoint:Reference audio/image/video etc. asset, return asset ID endpoint,.
Quick Example
()```bash curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/mureka/v1/song/generate" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <API_KEY>" \ -d '{ "lyrics": "[Verse]\nlocalized example text\n[Chorus]\nin will", "model": "auto", "prompt": "pop, sad, summer", "n": 2 }'
return task`id`:
```json{
"id": "1523127798xxxxx",
"created_at": 1785306793,
"model": "mureka-9",
"status": "preparing",
"trace_id": "xxxxxxxx"
}
### query task (Polling)```bash
curl "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/mureka/v1/song/query/1523127798xxxxx" \
-H "Authorization: Bearer <API_KEY>"complete after returnstatus: succeeded and list:```json
{
"id": "1523127798xxxxx",
"created_at": 1785306793,
"finished_at": 1785306839,
"model": "mureka-9",
"status": "succeeded",
"choices": [
{
"id": "1523128698xxxxx",
"url": "https://cdn.example.com/song/xxxxx.mp3",
"flac_url": "https://cdn.example.com/song/xxxxx.flac",
"duration": 128000
}
],
"trace_id": "xxxxxxxx"
}
> ⚠️ **localized example text`song_id`**:,,,, etc. endpoint`song_id` Parameter, query results`choices[].id` (**id**), **localized example text**task`id`.will return`The corresponding song is not found`.
### Generate Lyrics ()```bash
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/mureka/v1/lyrics/generate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{ "prompt": "," }'returned when applicable and:```json
{
"title": "localized example text",
"lyrics": "[Verse]\nlocalized example text\n...",
"trace_id": "xxxxxxxx"
}
## Endpoints
### endpoint (Polling query )| Capability | Method | Path | query endpoint|
| ---------- | ---- | --------------------------------------------------- | --------------------- |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/generate` | task query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/easy-generate` | task query|
| Music Generation| POST | `/api/v2/open/aigc/mureka/v1/instrumental/generate` | musictask query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/soundtrack/generate` | task query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/extend` | task query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/remix` | task query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/region-edit` | task query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/track/generate` | task query|
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/stem` | task query|
| musiclocalized example text| POST | `/api/v2/open/aigc/mureka/v1/song/transcribe` | task query|
| video| POST | `/api/v2/open/aigc/mureka/v1/lyrics-video/generate` | task query|
### query endpoint| Capability | Method | Path |
| ------------ | ---- | -------------------------------------------------------- |
| task query| GET | `/api/v2/open/aigc/mureka/v1/song/query/{task_id}` |
| music query| GET | `/api/v2/open/aigc/mureka/v1/instrumental/query/{task_id}` |
> endpoint (////////video)「task query」, musicendpoint「music query」.`{task_id}` as create endpoint return`id`.
### synchronous endpoint (returned when applicable)| Capability | Method | Path |
| ---------- | ---- | ------------------------------------------------ |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/lyrics/generate` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/lyrics/extend` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/recognize` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/describe` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/song/vocal-clone` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/tts/generate` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/tts/podcast` |
### endpoint ()| Capability | Method | Path |
| ------------ | ---- | -------------------------------------------------- |
| File Upload | POST | `/api/v2/open/aigc/mureka/v1/files/upload` |
| create| POST | `/api/v2/open/aigc/mureka/v1/uploads/create` |
| localized example text| POST | `/api/v2/open/aigc/mureka/v1/uploads/add` |
| complete| POST | `/api/v2/open/aigc/mureka/v1/uploads/complete` |
## Parameters
### 1. localized example text**POST** `/v1/song/generate`
| Parameter | Type | Required | Description |
| ------------ | ------- | ---- | ----------------------------------------------------------------- |
| lyrics | string | localized example text|, supported`[Verse]`/`[Chorus]` etc., maximum 5000 characters. |
| model | string | localized example text| Model:`auto` / `mureka-7.6` / `mureka-o2` / `mureka-8` / `mureka-9` / `mureka-9.5`. |
| prompt | string | localized example text| Prompt,`r&b, slow, male vocal`, maximum 1024 characters. |
| duration | integer | localized example text| Duration (seconds), 120~300, only `mureka-9.5` supported; If omittedModel ( will Duration). |
| n | integer | localized example text| Number of outputs, 1~3, default 2. |
| gender | string | localized example text|:`female` / `male`. |
| reference_id | string | localized example text| reference music ID (File Upload purpose=reference ). |
| vocal_id | string | localized example text| ID (). |
| melody_id | string | localized example text| ID (File Upload purpose=melody ). |
| stream | boolean | localized example text| after task streaming, can. |
### 2. localized example text**POST** `/v1/song/easy-generate`
| Parameter | Type | Required | Description |
| ------------ | ------- | ---- | --------------------------------------------- |
| prompt | string | localized example text|, maximum 2000 characters. |
| model | string | localized example text| Model:`auto` / `mureka-7.6` / `mureka-o2` / `mureka-8` / `mureka-9` / `mureka-9.5`. |
| n | integer | localized example text| Number of outputs, 1~3, default 2. |
| styles | array | localized example text|, can (`pop` / `rock` / `jazz` / `r&b` / `edm`). |
| reference_id | string | localized example text| reference music ID. |
| vocal_id | string | localized example text| ID. |
| stream | boolean | localized example text| after task streaming. |
### 3. Music Generation**POST** `/v1/instrumental/generate`
| Parameter | Type | Required | Description |
| --------------- | ------- | ---- | --------------------------------------------- |
| model | string | localized example text| Model:`auto` / `mureka-7.6` / `mureka-8` / `mureka-9` / `mureka-9.5`. |
| prompt | string | localized example text| Prompt,`epic orchestral, cinematic`, maximum 1024 characters. |
| n | integer | localized example text| Number of outputs, 1~3, default 2. |
| instrumental_id | string | localized example text| reference music ID (File Upload purpose=instrumental ). |
| stream | boolean | localized example text| after task streaming. |
> musictask「music query」endpointPollinglocalized example text.
### 4. localized example text**POST** `/v1/soundtrack/generate`
as image or Video Generation.
| Parameter | Type | Required | Description |
| ----------- | ------- | ---- | -------------------------------------------------------- |
| image_id | string | Condition | image ID ( and`video_id` ). |
| video_id | string | Condition | video ID ( and`image_id` ). |
| model | string | localized example text| Model:`auto` / `mureka-7.6` / `mureka-8` / `mureka-9` / `mureka-9.5`. |
| prompt | string | localized example text| Scenario/, maximum 1024 characters. |
| n | integer | localized example text| Number of outputs, 1~3, default 2. |
| audio_start | integer | localized example text| when (seconds), 3 seconds. |
| audio_end | integer | localized example text| when (seconds), Duration. |
### 5. localized example text**POST** `/v1/song/extend`
| Parameter | Type | Required | Description |
| --------------- | ------- | ---- | ------------------------------------------- |
| song_id | string | Condition | Song ID ( and`upload_audio_id` ). |
| upload_audio_id | string | Condition | Uploaded audio ID (and`song_id` ). |
| lyrics | string | localized example text| localized example text. |
| extend_type | string | localized example text|:`tail` after /`head` first. |
| extend_at | integer | localized example text| when (seconds), head/tail can. |
| model | string | localized example text| Model:`mureka-8`. |
### 6. localized example text**POST** `/v1/song/remix`
| Parameter | Type | Required | Description |
| --------------- | ------- | ---- | ------------------------------------------ |
| song_id | string | Condition | Song ID ( and`upload_audio_id` ). |
| upload_audio_id | string | Condition | Uploaded audio ID (and`song_id` ). |
| lyrics | string | localized example text|, maximum 5000 characters. |
| prompt | string | localized example text| Prompt, maximum 1024 characters;`mureka-9.5` can in in. |
| model | string | localized example text| Model:`mureka-8` (audio 10~350 seconds)/ `mureka-9.5` (audio 10~480 seconds, supported,, music).If omitteddefault `mureka-9.5`. |
| n | integer | localized example text| Number of outputs, 1~3, default 2. |
### 7. localized example text**POST** `/v1/song/region-edit`
localized example text.
| Parameter | Type | Required | Description |
| --------------- | ------- | ---- | ------------------------------------------ |
| song_id | string | Condition | Song ID ( and`upload_audio_id` ). |
| upload_audio_id | string | Condition | Uploaded audio ID (and`song_id` ). |
| lyrics | string | localized example text|, maximum 3000 characters. |
| edit_start | integer | localized example text| (seconds), 3 seconds. |
| edit_end | integer | localized example text| (seconds), 3 seconds. |
### 8. localized example text**POST** `/v1/track/generate`
as Type.
| Parameter | Type | Required | Description |
| --------------- | ------- | ---- | ------------------------------------------------------------- |
| song_id | string | Condition | Song ID ( and`upload_audio_id` ). |
| upload_audio_id | string | Condition | Uploaded audio ID (and`song_id` ). |
| generate_type | string | localized example text| Type:`Vocals` / `Instrumental` / `Drums` / `Bass` / `Guitar` / `Keyboard` / `Percussion` / `Strings` / `Synth` / `FX` / `Brass` / `Woodwinds`. |
| prompt | string | localized example text|, maximum 1024 characters. |
| lyrics | string | Condition | `generate_type=Vocals` when Required. |
| vocal_gender | string | localized example text|:`male` / `female` (only Vocals ). |
| generate_start | integer | localized example text| when (seconds). |
| generate_end | integer | localized example text| when (seconds). |
### 9. localized example text**POST** `/v1/song/stem`
will as.
| Parameter | Type | Required | Description |
| ----- | ------ | ---- | ------------------------------------------------------- |
| url | string | localized example text| URL. |
| model | string | localized example text| Model:`audio-separation-1` / `-2` / `-3`. |
### 10. musiclocalized example text**POST** `/v1/song/transcribe`
| Parameter | Type | Required | Description |
| --------------- | ------ | ---- | --------------------------------------------- |
| song_id | string | Condition | Song ID (, 1 valid). |
| upload_audio_id | string | Condition | Uploaded audio ID (, File Upload purpose=audio). |
| url | string | Condition | audio (). |
### 11. video**POST** `/v1/lyrics-video/generate`
| Parameter | Type | Required | Description |
| ---------------- | ------- | ---- | -------------------------------------------------------- |
| song_id | string | Condition | Song ID (and`upload_audio_id` ). |
| upload_audio_id | string | Condition | Uploaded audio ID (File Upload purpose=audio). |
| background_id | string | localized example text| image ID (File Upload purpose=lyrics-video). |
| cover | string | localized example text| (`.jpg`/`.jpeg`/`.png`/`.webp`). |
| title | string | localized example text| videolocalized example text. |
| aspect_ratio | string | localized example text| dimensions:`16:9` / `9:16` / `3:4` / `4:3`, default `9:16`. |
| layout | string | localized example text| localized example text`layout_1`~`layout_7`, default `layout_1` (supported ). |
| lyrics_start_row | integer | localized example text| ( and`selection_*`, music supported ). |
| lyrics_end_row | integer | localized example text| ( and`selection_*`, music supported ). |
| selection_start | integer | localized example text| when (seconds, and`lyrics_*_row` ). |
| selection_end | integer | localized example text| when (seconds, and`lyrics_*_row` ). |
### 12. ()**POST** `/v1/lyrics/generate`
| Parameter | Type | Required | Description |
| ------ | ------ | ---- | -------------------------- |
| prompt | string | localized example text|, or. |
### 13. ()**POST** `/v1/lyrics/extend`
| Parameter | Type | Required | Description |
| ------ | ------ | ---- | -------------- |
| lyrics | string | localized example text| localized example text. |
### 14. ()**POST** `/v1/song/recognize`
| Parameter | Type | Required | Description |
| --------------- | ------ | ---- | ------------- |
| upload_audio_id | string | localized example text| Uploaded audio ID. |
### 15. ()**POST** `/v1/song/describe`, etc..
| Parameter | Type | Required | Description |
| ---- | ------ | ---- | ----------------------------- |
| url | string | localized example text| URL or`data:audio` base64. |
### 16. ()**POST** `/v1/song/vocal-clone`
audio, return ID.
| Parameter | Type | Required | Description |
| --------------- | ------ | ---- | ------------- |
| upload_audio_id | string | localized example text| Uploaded audio ID. |
### 17. TTS ()**POST** `/v1/tts/generate`
| Parameter | Type | Required | Description |
| -------- | ------ | ---- | --------------------------------------------- |
| text | string | localized example text|, maximum 500 characters. |
| voice | string | Condition | ( and`voice_id` ). |
| voice_id | string | Condition | reference ID (File Upload purpose=voice, and`voice` ). |
### 18. ()**POST** `/v1/tts/podcast`
character.
| Parameter | Type | Required | Description |
| ------------- | ----- | ---- | --------------------------------------------- |
| conversations | array | localized example text|, up to 10;`text` (≤400 characters)and`voice` (). |
Request Example:
```json{
"conversations": [
{ "text": ",.", "voice": "Ethan" },
{ "text": "localized example text.", "voice": "Victoria" }
]
}
### 19. asset**POST** `/v1/files/upload` (`multipart/form-data`)
Reference audio/image/video etc. asset, return asset ID endpoint`reference_id` / `vocal_id` / `image_id` / `upload_audio_id` etc. field.file can use endpoint (`/v1/uploads/create` → `/v1/uploads/add` → `/v1/uploads/complete`).
## Task StatusDescription
task query return`status`:| status | Description |
| ---------- | ------------------ |
| preparing | taskcreate, in|
| queued | queued |
| running | in|
| streaming | output in|
| succeeded | complete, can use|
| failed | Failure|
| timeouted | when|
| cancelled | localized example text|
> taskFailure (`failed` / `timeouted` / `cancelled`)when, will.
## Pollingand when recommended
/music etc. as task, recommendedPolling:
- First 30 seconds:query every 5 seconds- 30 seconds ~ 2 minutes:query every 10 seconds
- After 2 minutes:15 seconds query
Processing Time Reference:
- /:Usually 3~ 10 seconds (return )
- / music /:Usually 30 seconds~ 2 minutes
- /:Usually 10~ 30 seconds
## ModelDescription
| Model | Description |
| ---------- | -------------------------------- |
| auto | Model ( first as mureka-9.5)|
| mureka-7.6 | Model|
| mureka-o2 | Model|
| mureka-8 | Model|
| mureka-9 | Model (only/Music Generation supported )|
| mureka-9.5 | Model ( supported Duration; supported audio and //music; supported )|
## Error Codes
| code | Description |
| ----- | ------------------ |
| 0 | Success |
| 10002 | Parametermissing or malformed |
| 10005 | API Key invalid or missing |
| 40001 | Insufficient balance |
| 90003 | Internal server error |
endpointwhen JSON; Error (Path supported, Insufficient balance) return:```json
{
"code": 40001,
"msg": "insufficient balance",
"data": null
}