Skip to content

MaaS_Mureka API

This request method is only applicable to the MaaS_Mureka_o2、MaaS_Mureka_v7.6 models。 For the MaaS_Mureka_o1 、MaaS_Mureka_v7.5 ,please refer to MaaS_Mureka_v7.5

Request Protocol

Http

Parameters Values
Authorization Bearer {YOUR AK}
Content-Type application/json

Generate Songs

Request Method

POST

Request URL

https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/song/generate

Request Parameters

Field Type Required Description
lyrics string Yes Lyrics content (required)
n int No Number of songs generated per request, maximum 3, default is 2
prompt string No Song prompt, maximum 1024 characters.
After selecting this option, other control options (reference_id, vocal_id, melody_id) cannot be selected.
reference_id string No Reference music ID, generated by files/upload API (purpose: reference)
After selecting this option, other control options (prompt, melody_id) cannot be selected.
vocal_id string No Vocal ID, generated by files/upload API (purpose: vocal)
After selecting this option, other control options (prompt, melody_id) cannot be selected.
melody_id string No Melody ID, generated by files/upload API (purpose: melody)
After selecting this option, other control options (prompt, reference_id, vocal_id) cannot be selected.
stream boolean No If set to true, the status of the generation task will include a streaming phase.
During this phase, you can obtain the stream_url of the generated song and play the URL to achieve playing while generating.
This mode is not supported when the model is mureka-o1

Request Example

curl -X 'https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/song/generate' \
-H 'Authorization:  Bearer ${Your AK}' \
-H 'Content-Type:  application/json' \
-d '{
  "lyrics": "【Verse 1】\nYouth blooms like flowers\nDreams fly in the heart\n\n【Chorus】\nYouth and dreams\nForever in the heart",
  "n": 1,
  "stream": true,
  "prompt": "Create a pop song about youth and dreams"
}'

Response Parameters

Field Type Description
taskId string ID of the asynchronous song generation task.
created_at integer Unix timestamp (seconds) when the task was created.
finished_at integer Unix timestamp (seconds) when the task was completed.
model string Model used for song generation.
status string Current status of the task.
Valid values: preparing, queued, running, streaming, succeeded, failed, timeouted, cancelled
failed_reason string Reason for failure.

Response Example

{
    "code": 0,
    "data": {
        "taskId": "113923099721729",
        "trace_id": "eb174f86b6c59ba838ce4401b01678eb",
        "created_at": 1767001167,
        "finished_at": null,
        "model": "MaaS_Mureka_v7.6",
        "status": "preparing",
        "failed_reason": null,
        "watermarked": null,
        "choices": null
    },
    "code_msg": "success",
    "trace_id": "eb174f86b6c59ba838ce4401b01678eb"
}

Extend Songs

Request Method

POST

Request URL

https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/song/extend

Request Parameters

Field Type Required Description
song_id string No ID of the song to be extended, generated by song/generate API.
Mutually exclusive with upload_audio_id parameter
upload_audio_id string No Reference music ID, generated by files/upload API (purpose: reference)
lyrics string Yes Lyrics content (required)
extend_at string Yes Start time of extension (milliseconds). If greater than the song duration, it defaults to the song duration.
Valid range: [8000, 420000]

Request Example

curl -X 'https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/song/extend' \
-H 'Authorization:  Bearer ${Your AK}' \
-H 'Content-Type:  application/json' \
-d '{
  "song_id": "113875917733890",
  "extend_at": "8000",
  "lyrics": "[Verse]\nIn the stormy night, I wander alone\nLost in the rain, feeling like I have been thrown\nMemories of you, they flash before my eyes\nHoping for a moment, just to find some bliss"
}'

Response Parameters

Field Type Description
taskId string ID of the asynchronous song generation task.
created_at integer Unix timestamp (seconds) when the task was created.
finished_at integer Unix timestamp (seconds) when the task was completed.
model string Model used for song generation.
status string Current status of the task.
Valid values: preparing, queued, running, streaming, succeeded, failed, timeouted, cancelled
failed_reason string Reason for failure.

Response Example

{
    "code": 0,
    "data": {
        "taskId": "113893286346753",
        "trace_id": "22b0306de94dd63dc555719b66460e54",
        "created_at": 1767001167,
        "finished_at": null,
        "model": "MaaS_Mureka_v7.6",
        "status": "preparing",
        "failed_reason": null,
        "watermarked": null,
        "choices": null
    },
    "code_msg": "success",
    "trace_id": "eb174f86b6c59ba838ce4401b01678eb"
}

Query Task (Song)

Both song generation and extension tasks are queried through this interface

Request Method

GET

Request URL

https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/song/query/{task_id}

Request Example

curl -X 'https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/song/query/{task_id}' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${Your AK}'

Response Parameters

Field Type Description
taskId string ID of the asynchronous song generation task.
created_at integer Unix timestamp (seconds) when the task was created.
finished_at integer Unix timestamp (seconds) when the task was completed.
model string Model used for song generation.
status string Current status of the task.
Valid values: preparing, queued, running, streaming, succeeded, failed, timeouted, cancelled
failed_reason string Reason for failure.
choices.index integer Index of the song in the selection list.
choices.id string ID of the generated song.
choices.url string URL of the generated song, valid for one month.
choices.flac_url string URL of the lossless FLAC format audio, valid for one month.
choices.wav_url string URL of the lossless WAV format audio, valid for one month.
choices.stream_url string URL available during the streaming phase when the request parameter stream is set to true.
choices.duration integer Song duration (milliseconds)
choices.lyrics_sections.section_type string Section type.
Valid values: intro, verse, pre-chorus, chorus, bridge, break, outro
choices.lyrics_sections.start integer Section start time (milliseconds)
choices.lyrics_sections.end integer Section end time (milliseconds)
choices.lyrics_sections.lines.start integer Lyric line start time (milliseconds)
choices.lyrics_sections.lines.end integer Lyric line end time (milliseconds)
choices.lyrics_sections.lines.text string Text content in the lyric line.
choices.lyrics_sections.lines.words.start integer Word start time (milliseconds)
choices.lyrics_sections.lines.words.end integer Word end time (milliseconds)
choices.lyrics_sections.lines.words.text string Word content.

Response Example

{
    "code": 0,
    "data": {
        "taskId": "113905426890753",
        "trace_id": "bddd741b9119d64492e811966dc35a73",
        "created_at": 1766992740,
        "finished_at": 1766992759,
        "model": "MaaS_Mureka_v7.6",
        "status": "succeeded",
        "failed_reason": null,
        "watermarked": null,
        "choices": [
            {
                "index": null,
                "id": "113905464770561",
                "url": "https://cdn.mureka.ai/cos-prod/open/song/20251229/113366463152129-9DDrRrRu26n4iifY3Rgbyb.mp3",
                "wav_url": "https://cdn.mureka.ai/cos-prod/open/song/20251229/113366463152129-DY7ihYqasXszEqM4tvpYNj.wav",
                "flac_url": "https://cdn.mureka.ai/cos-prod/open/song/20251229/113366463152129-DY7ihYqasXszEqM4tvpYNj.flac",
                "stream_url": null,
                "duration": 41540,
                "lyrics_sections": [
                    {
                        "section_type": "intro",
                        "start": 2400,
                        "end": 2800,
                        "lines": [
                            {
                                "start": 2400,
                                "end": 2800,
                                "text": "Float song",
                                "words": [
                                    {
                                        "start": 2400,
                                        "end": 2760,
                                        "text": "Float "
                                    },
                                    {
                                        "start": 2760,
                                        "end": 2800,
                                        "text": "song"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "code_msg": "success",
    "trace_id": "bddd741b9119d64492e811966dc35a73"
}

Upload Files

Request Method

POST

Request URL

https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/files/upload

Parameters

form-data提交参数

form-data submission parameters

Field Type Required Description
file file Yes Content of the file to be uploaded
purpose string Yes File purpose
Valid values: reference, vocal, melody, instrumental, voice, audio
reference: Supported formats are mp3, m4a. Supported audio duration range is [30, 30] seconds, and the excess part will be cropped.
vocal: Supported formats (mp3, m4a). Use vocals extracted from the uploaded audio. Supported vocal duration range is 15 to 30 seconds, and the excess part will be cut off.
melody: Supported formats (mp3, m4a, mid). Use vocals extracted from the uploaded audio, it is recommended to upload MIDI files. Supported audio duration range is 5 to 60 seconds, and the excess part will be cut off.
instrumental: Supported formats are (mp3, m4a). Supported audio duration range is [30, 30] seconds, and the excess part will be cropped.
voice: Supported formats (mp3, m4a). Supported audio duration range is [5, 15] seconds, and the excess part will be cut off.
audio: Supported formats (mp3, m4a). Common audio file formats, used for song extension, etc.

Request Example

curl -X 'https://genaiapi.cloudsway.net/v1/ai/${Your endpoint}/mureka/files/upload' \
-H 'Authorization: Bearer ${Your AK}' \
-F 'file=@"/C:/Users/user/Downloads/music_songs_20251110.mp3"' \
-F 'purpose="audio"'

Response Parameters

Field Type Description
id string File identifier, which can be used to reference the file in API interfaces.
bytes integer File size in bytes.
created_at integer Unix timestamp (seconds) when the file was created.
filename string File name
purpose string Intended use of the file

Response Example

{
    "trace_id": "b4f3edecf8288f19652102e17eab3c91",
    "purpose": "audio",
    "created_at": 1767059534,
    "filename": "113366463152129-RcQK1qzNt73VBNCcW3JoQ6.mp3",
    "bytes": 3637542,
    "id": "114045503930371"
}