Skip to content

1. Model Description

The table below lists the capabilities supported by each encoding (✅ supported, — not supported). File upload and task query are available on any endpoint that has enabled at least one generation capability.

Product Code Lyric Composition Turning Prompts into Music Instrumental Music Song Extension Description
MaaS_Mureka_v9.5 ✅ ✅ ✅ — —
MaaS_Mureka_v9 ✅ ✅ ✅ — —
MaaS_Mureka_v8 ✅ ✅ ✅ ✅ Extension direction: extend_type (head/tail)
MaaS_Mureka_v7.6 ✅ ✅ ✅ ✅ Extend only the tail; the valid range of extend_at is [8000,420000] ms
MaaS_Mureka_o2 ✅ ✅ — — Lyric-to-music generation does not support vocal_id or melody_id; prompt-to-music generation does not support vocal_id

2. Billing

2.1 Billing Items and Usage of the Platform

chargeItemCode Chinese name Trigger Interface
lyrics_to_song Lyric Composition POST .../song/generate
prompt_to_song Turning Prompts into Music POST .../song/easy-generate
bgm_generation Instrumental Music Generation POST .../instrumental/generate
song_extension Song Extension POST .../song/extend

3. Details of Functional Interfaces

Parameter Name Field Type Description
id string Task ID for asynchronous song generation task
created_at integer Unix timestamp (in seconds) of the task creation time
finished_at integer Unix timestamp (in seconds) of the task completion time
status string Current status of the task. Enumeration: preparing, queued, running, streaming, succeeded, failed, timeouted, cancelled
failed_reason string Cause of Failure (Upon Failure)
choices array List of successfully generated songs (when statusis succeeded); elements contain audio information such as url, duration, stream_url, etc.

3.1 Lyrics to song

3.1.1 Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/generate

3.1.2 Request Body Parameters

Parameter Name Field Type Required or not default value Description
lyrics string Yes - Generate song lyrics, with a maximum of 5000 characters
n integer No 2 The number of songs generated per request defaults to 2, with a maximum of 3. Billing will be based on the number of songs generated.
prompt string No - Control music generation via prompts, with a maximum of 1024 characters. It can be used alone or in combination with other options, such as prompt + vocal_id.
gender string No - Specify the preferred vocal gender for the generated song (enumeration: female, male); if the uploaded audio already contains vocal features, the uploaded audio shall prevail
reference_id string No - Generated with reference to music control, the ID is obtained via upload through the files/upload interface (purpose: reference). It can be used alone or in combination with parameters such as reference_id and vocal_id.
vocal_id string No - Use the specified timbre, whose ID is generated by the song/vocal-clone interface. It can be used alone or in combination with reference_id, prompt, etc.
melody_id string No - Generated via melody creative control, with the ID obtained from files/upload (purpose: melody). It can only be used independently and cannot be combined with other control items.
stream boolean No false When set to true, the task status will include the streaming phase, during which you can obtain stream_urlfor playback while generation is in progress; some legacy endpoints do not support streaming

3.1.3 Response Parameters (data)

See the section "Response Parameters for Song-related Tasks" above.

3.1.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/generate' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
  "lyrics": "[Verse]\nIn the stormy night, I wander alone",
  "prompt": "r&b, slow, passionate, male vocal",
  "n": 2
}'

3.1.5 Response Example

{
  "code": 0,
  "code_msg": "success",
  "trace_id": "trace-xxx",
  "data": {
    "id": "1436211",
    "created_at": 1677610602,
    "status": "preparing"
  }
}

3.2 Prompt to song

3.2.1 Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/easy-generate

3.2.2 Request Body Parameters

Parameter Name Field Type Required or not default value Description
n integer No 2 The number of songs generated per request defaults to 2, with a maximum of 3. Billing will be based on the number of songs generated.
styles array No - Generated via style control; one or more can be selected from the enumeration: pop, rock, jazz, r\&b, edm, ambient, folk, latin, k-pop, j-pop, house, gospel, lo-fi
prompt string No - Control music generation via prompts, with a maximum of 2000 characters
reference_id string No - Generated by reference to music control, the ID is obtained from files/upload (purpose: reference)
vocal_id string No - Use the specified voice timbre, whose ID is generated via the song/vocal-clone interface
stream boolean No false When set to true, the task status will include the streaming phase, from which you can obtain stream_urlfor playback while generation is in progress

3.2.3 Response Parameters (data)

Refer to "Response Parameters for Song-related Tasks".

3.2.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/easy-generate' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
  "styles": ["pop", "rock"],
  "prompt": "A bright summer love song with a catchy chorus",
  "n": 2
}'

3.2.5 Response Example

Same as §3.1.5.


3.3 Generate instrumental

3.3.1 Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/instrumental/generate

3.3.2 Request Body Parameters

Parameter Name Field Type Required or not default value Description
n integer No 2 The number of instrumental tracks generated per request defaults to 2, with a maximum of 3. Charges will be applied based on the number of tracks generated.
prompt string No - Control the generation of instrumental music via prompts, with a maximum of 1024 characters. This can only be used independently and cannot be combined with other control items.
instrumental_id string No - Generated with reference to music control, the ID is obtained from files/upload (purpose: instrumental). For standalone use only
stream boolean No false When set to true, the task status will include the streaming phase, from which you can obtain stream_urlfor playback while generation is in progress

3.3.3 Response Parameters (data)

Parameter Name Field Type Description
id string Task ID for asynchronous pure music generation task
created_at integer Unix timestamp (in seconds) of the task creation time
finished_at integer Unix timestamp (in seconds) of the task completion time
status string Current status of the task (enumeration applies to tasks of the same song category)
failed_reason string Cause of failure
choices array List of successfully generated instrumental music (when statusis succeeded)

3.3.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/instrumental/generate' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
  "prompt": "r&b, slow, passionate"
}'

3.3.5 Response Example

Same as §3.1.5 (data.idis the ID of the instrumental music task).


3.4 Extend song

3.4.1 Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/extend

3.4.2 Request Body Parameters

Parameter Name Field Type Required or not default value Description
song_id string No - The ID of the song to be extended, which is generated by song/generate; only songs generated within the last month are supported. This parameter is mutually exclusive with upload_audio_id.
upload_audio_id string No
- The upload ID of the audio to be extended, which is obtained from files/upload (purpose: audio). Mutually exclusive with song_id.
lyrics string Yes - For extended lyrics, up to 3000 characters
extend_at integer Yes - Delay start time (milliseconds). If the value exceeds the song duration, it will be processed as the song duration; for some pipelines, the valid range is [8000,420000]
extend_type string No - Extension direction: tailextends from the end of the audio, headextends from the start. Whether this field is required and its available values depend on the capabilities of the upstream model corresponding to the current access endpoint.

3.4.3 Response Parameters (data)

Refer to "Response Parameters for Song-related Tasks".

3.4.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/extend' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--data '{
  "upload_audio_id": "43543541",
  "lyrics": "[Verse]\nIn the stormy night",
  "extend_at": 12234
}'

3.4.5 Response Example

Same as §3.1.5.


3.5 Upload file

3.5.1 Request URL

POST https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/files/upload

Content-Type: multipart/form-data

3.5.2 Request Form Parameters

Parameter Name Field Type Required or not default value Description
file file No - The file object to be uploaded (not the file name), with a maximum size of 10 MB. Mutually exclusive with the url parameter.
url string No - The URL of the file to be uploaded. Mutually exclusive with the file parameter.
purpose string Yes - Upload purpose, enumeration and format requirements: reference (mp3/m4a, duration [30,30] seconds, files exceeding the limit will be cropped);
melody (mp3/m4a/mid, MIDI recommended, with vocal extraction, duration [5,60] seconds);
instrumental (mp3/m4a, duration: [30,30] seconds);
voice (mp3/m4a, duration: [5,15] seconds);
audio (mp3/m4a, ≤10 MB, general audio, for extension and other purposes);
remix (mp3/m4a, duration: [10,350] seconds);
soundtrack (video or image; for large files, please provide a URL; supported video formats: mp4/mov/avi/mkv/webm, file size ≤100 MB; supported image formats: jpg/jpeg/png/webp, file size ≤50 MB);
lyrics video (jpg/jpeg/png/webp/gif, background image for lyric video)

3.5.3 Response Parameters

Parameter Name Field Type Description
id string File ID, which can be referenced in other interfaces
bytes integer File Size (Bytes)
created_at integer Unix timestamp (in seconds) of the creation time
filename string File Name
purpose string The purpose specified during upload

3.5.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/files/upload' \
--header 'Authorization: Bearer {YOUR_AK}' \
--form 'purpose="reference"' \
--form 'file=@mydata.mp3'

3.5.5 Response Example

{
  "id": "542321",
  "filename": "mydata.mp3",
  "bytes": 120000,
  "created_at": 1677610602,
  "purpose": "reference"
}

3.6 Query song task

3.6.1 Request URL

GET https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/query/{taskId}

3.6.2 Path Parameters

Parameter Name Field Type Required or not Description
taskId string Yes task_id for the song generation task

3.6.3 Response Parameters (data)

Refer to "Response Parameters for Song-related Tasks".

3.6.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/song/query/435134' \
--header 'Authorization: Bearer {YOUR_AK}'

3.7 Query instrumental task

3.7.1 Request URL

GET https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/instrumental/query/{taskId}

3.7.2 Path Parameters

Parameter Name Field Type Required or not Description
taskId string Yes the task_id of the instrumental music generation task

3.7.3 Response Parameters (data)

Same as §3.3.3.

3.7.4 Request Example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/mureka/instrumental/query/435134' \
--header 'Authorization: Bearer {YOUR_AK}'