Minimax Music-01

Generate up to 60 seconds of music with both accompaniment and vocals in a single pass, with vocals from lyrics and a reference track.

~43.93s
~$0.069
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/minimax-music-01"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "lyrics": "[verse]  \n In the silence, I hear your name  \n Echoes of love that still remain  \n Fading lights and midnight rain  \n I’m lost in yesterday again  \n [chorus]  \n But I still dream, I still try  \n To hold your ghost beneath the sky ",
12    "bitrate": 256000,
13    "song_file": "https://replicate.delivery/pbxt/M9zum1Y6qujy02jeigHTJzn0lBTQOemB7OkH5XmmPSC5OUoO/MiniMax-Electronic.wav",
14    "sample_rate": 44100
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20    result = response.json()
21    print(json.dumps(result, indent=2))
22else:
23    print(f"Error: {response.status_code}")
24    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/minimax-music-01

Parameters

bitrateoptional
integer

An enumeration.

Default: 256000
Allowed values :
3200064000128000256000
instrumental_fileoptional
string (uri)

Instrumental reference. Must be a .wav or .mp3 file longer than 15 seconds. If only an instrumental reference is given, a track without vocals will be generated.

Default: null
instrumental_idoptional
string

Previously used instrumental ID

Default: null
lyricsoptional
string

Format your lyrics using newlines to separate each line. Use two newlines to add a pause. Wrap the lyrics with ## to include accompaniment. Max 400 characters.

Default: "[verse] \n In the silence, I hear your name \n Echoes of love that still remain \n Fading lights and midnight rain \n I’m lost in yesterday again \n [chorus] \n But I still dream, I still try \n To hold your ghost beneath the sky "
sample_rateoptional
integer

Sample rate for the output file.

Default: 44100
Allowed values :
16000240003200044100
song_fileoptional
string (uri)

Reference song. Should include both music and vocals; Supported formats: wav or .mp3; Minimum length: 15 seconds

Default: "https://replicate.delivery/pbxt/M9zum1Y6qujy02jeigHTJzn0lBTQOemB7OkH5XmmPSC5OUoO/MiniMax-Electronic.wav"
voice_fileoptional
string (uri)

Reference file for voice; Must be a .wav or .mp3 file longer than 15 seconds. If only a voice reference is given, an a cappella vocal hum will be generated.

Default: null
voice_idoptional
string

Previously used voice ID

Default: null

Response Type

Returns: Audio

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out