Skip to main content
POST
/
v1
/
music_cover_preprocess
Music Cover Preprocess
curl --request POST \
  --url https://api.minimax.io/v1/music_cover_preprocess \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "model": "music-cover",
  "audio_url": "https://example.com/song.mp3"
}
'
import requests

url = "https://api.minimax.io/v1/music_cover_preprocess"

payload = {
"model": "music-cover",
"audio_url": "https://example.com/song.mp3"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({model: 'music-cover', audio_url: 'https://example.com/song.mp3'})
};

fetch('https://api.minimax.io/v1/music_cover_preprocess', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.io/v1/music_cover_preprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'music-cover',
'audio_url' => 'https://example.com/song.mp3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.minimax.io/v1/music_cover_preprocess"

payload := strings.NewReader("{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.minimax.io/v1/music_cover_preprocess")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.minimax.io/v1/music_cover_preprocess")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}"

response = http.request(request)
puts response.read_body
{
  "cover_feature_id": "a1b2c3d4e5f67890abcdef1234567890",
  "formatted_lyrics": "[Verse 1]\nFirst line of the song\nSecond line continues\n\n[Chorus]\nThis is the chorus\nSinging out loud",
  "structure_result": "{\"num_segments\":4,\"segments\":[{\"start\":0,\"end\":15.5,\"label\":\"intro\"},{\"start\":15.5,\"end\":45.2,\"label\":\"verse\"},{\"start\":45.2,\"end\":75.0,\"label\":\"chorus\"},{\"start\":75.0,\"end\":90.0,\"label\":\"outro\"}]}",
  "audio_duration": 90,
  "trace_id": "061e5f144eb7f10b1fdde81126e24f91",
  "base_resp": {
    "status_code": 0,
    "status_msg": "success"
  }
}

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

Headers

Content-Type
enum<string>
default:application/json
required

The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.

Available options:
application/json

Body

application/json
model
enum<string>
required

Model name. Must be music-cover.

Available options:
music-cover
audio_url
string

URL of the reference audio. Exactly one of audio_url or audio_base64 must be provided.

Reference audio constraints:

  • Duration: 6 seconds to 6 minutes
  • Size: max 50 MB
  • Format: common audio formats (mp3, wav, flac, etc.)
audio_base64
string

Base64-encoded reference audio. Exactly one of audio_url or audio_base64 must be provided.

Reference audio constraints:

  • Duration: 6 seconds to 6 minutes
  • Size: max 50 MB
  • Format: common audio formats (mp3, wav, flac, etc.)

Response

200 - application/json
cover_feature_id
string

Unique identifier for the preprocessed audio features. Valid for 24 hours. Pass this to the Music Generation API cover_feature_id parameter for two-step cover generation.

Same audio content returns the same cover_feature_id (MD5-based deduplication).

formatted_lyrics
string

Structured lyrics extracted from the reference audio via ASR, formatted with section tags such as [Verse], [Chorus], [Bridge], etc. You can modify these lyrics before passing them to the Music Generation API.

structure_result
string

JSON string containing the song structure analysis result, including segment types (intro, verse, chorus, bridge, outro, inst, silence) and their start/end timestamps in seconds.

audio_duration
number<double>

Duration of the reference audio in seconds.

trace_id
string

Unique trace ID for request tracking.

base_resp
object

Status code and details