MiniMax

August 24, 2026 · View on GitHub

Mode: 🔑 MiniMax API · Contract: stable public API · Domain: api.minimax.io / api.minimaxi.com

Generate music through MiniMax's documented Bearer-authenticated API. The adapter does not use a browser session. Set MINIMAX_API_KEY to a key issued for the selected deployment.

Important

MiniMax changed Music API availability on August 20, 2026. New users no longer receive the paid Music Generation API; existing paid / Token Plan users may continue using it. The music-3.0-free and music-2.6-free APIs have stopped, so this command exposes only music-3.0 and music-2.6.

--regionEndpointOfficial schema
global (default)https://api.minimax.io/v1/music_generationGlobal OpenAPI
cnhttps://api.minimaxi.com/v1/music_generationChina OpenAPI

Command

opencli minimax music [prompt]

Generation can spend quota, so --execute is always required.

export MINIMAX_API_KEY=<your-api-key>

# Instrumental track; returns a 24-hour download URL
opencli minimax music "warm lo-fi piano, 80 BPM" \
  --instrumental --execute

# Vocal track with supplied lyrics
opencli minimax music "dream pop, shoegaze guitars" \
  --lyrics "[Verse]
Night rain on the window" \
  --audio-format wav --sample-rate 44100 --execute

# Ask MiniMax to generate lyrics from the prompt
opencli minimax music "anthemic stadium rock" \
  --lyrics-optimizer --execute

# Decode inline hex audio and atomically save it locally
opencli minimax music "ambient drone" \
  --instrumental --output-format hex --op ~/Music/minimax --execute

# China deployment with its optional AIGC watermark
opencli minimax music "国风古筝,慢板" \
  --instrumental --region cn --aigc-watermark --execute

Inputs

OptionContract
promptStyle, mood, and scenario; maximum 2000 characters
--lyricsStructured lyrics; maximum 3500 characters
--modelmusic-3.0 (default) or music-2.6
--regionglobal (default) or cn
--output-formaturl (default) or hex
--audio-formatmp3 (default), wav, or pcm
--sample-rate16000, 24000, 32000, or 44100
--bitrate32000, 64000, 128000, or 256000
--instrumentalRequires prompt; cannot be combined with lyrics or lyrics optimizer
--lyrics-optimizerAllows vocal generation without lyrics when prompt is present
--aigc-watermarkAccepted only by --region cn
--opDirectory used only with --output-format hex
--timeoutHTTP timeout in seconds, 1–1800 (default 600)
--executeConfirms the billable request

Without --instrumental, supply --lyrics, or combine prompt with --lyrics-optimizer. All arguments, credentials, and hex output preflight are validated before the network request.

Output

ColumnDescription
statuscompleted; incomplete responses fail instead of returning a row
modelRequested model
regionglobal or cn
output_formaturl or hex
audio_formatmp3, wav, or pcm
audio_urlHTTPS URL for URL output, otherwise null
fileSaved path for hex output, otherwise null
expires_in_hours24 for URL output, otherwise null

The non-streaming API returns data.status but no resumable task identity or query endpoint. Therefore status 1 (in progress) is an error: the command does not return a misleading success row and never automatically submits a second billable request. A response trace_id, when present, is shown only as diagnostic evidence; it is not a task ID.

A client timeout or network failure can occur after MiniMax accepted the request. In that case result and billing state are unknown; check MiniMax account history before retrying. URL output expires after 24 hours. Hex output is decoded, size/signature checked when evidence is available, and published from a same-directory staging file with an atomic no-clobber hard link. A same-name lock is acquired before the billable request; collisions and failed writes neither overwrite an existing track nor leave partial audio behind.