Minimax Music Generation API Usage Guide
Overview
Minimax Music 2.5 is an AI-powered music generation model that creates complete songs from lyrics and style descriptions. Simply provide your lyrics and an optional style prompt, and the model will compose and produce a full audio track.Key Features:
- Lyrics-Based Generation: Create songs from your custom lyrics (1-3500 characters)
- Style Control: Optional prompt to specify music genre, mood, and style (0-2000 characters)
- Structure Tags: Support for song structure tags like [Verse], [Chorus], [Bridge], etc.
- High-Quality Audio: Output in MP3, WAV, or PCM formats
- Synchronous Operation: Get results immediately (typically 30-60 seconds)
Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header:Submit Music Generation Request
Endpoint
Request Format
Request Parameters
| Parameter | Type | Required | Description | Default | Constraints |
|---|---|---|---|---|---|
model | string | Yes | Model identifier | - | "minimax-music-2.5" |
payload.lyrics | string | Yes | Song lyrics. Use \n for line breaks. Support structure tags like [Verse], [Chorus], [Bridge], etc. | - | 1-3500 characters |
payload.prompt | string | No | Music style description (genre, mood, scenario) | - | 0-2000 characters |
payload.sample_rate | integer | No | Audio sample rate in Hz | 44100 | 16000, 24000, 32000, 44100 |
payload.bitrate | integer | No | Audio bitrate in bps | 256000 | 32000, 64000, 128000, 256000 |
payload.format | string | No | Output audio format | ”mp3" | "mp3”, “wav”, “pcm” |
Supported Structure Tags
You can use the following tags in your lyrics to control song structure:[Intro]- Introduction section[Verse]- Verse section[Pre Chorus]- Pre-chorus section[Chorus]- Chorus/refrain section[Bridge]- Bridge section[Outro]- Outro/ending section[Interlude]- Instrumental interlude[Hook]- Hook section[Inst]- Instrumental section[Solo]- Solo section
Response
Music Generation is synchronous and returns the result immediately (typically within 30-60 seconds).Check Request Status
Endpoint
Example
Response
Request Status Values
Music Generation is synchronous, so the response will immediately return one of these statuses:| Status | Description |
|---|---|
success | Music generation completed successfully |
failed | Music generation failed (see error message) |
Example Use Cases
Basic Music Generation (Minimal Parameters)
Full Music Generation (All Parameters)
Tips for Best Results
- Use Structure Tags: Adding tags like [Verse], [Chorus], [Bridge] helps the model understand song structure
- Descriptive Prompts: Be specific about genre, mood, instruments, and tempo in your prompt
- Appropriate Lyrics Length: Aim for 500-2000 characters for optimal song length
- Clear Line Breaks: Use
\nto separate lines properly