music-generation
AI music generation via micropayments. No API keys needed.
Generate full-length music tracks with lyrics, instrumental, or custom style prompts — paid per track with USDC on Base.
MiniMax always generates a ~3 minute track per call. Generation takes 1-3 minutes. Plan accordingly.
Available Models
| Model | Price | Notes |
|---|---|---|
| minimax/music-2.5+ | $0.1575 | MiniMax flagship — supports lyrics, instrumental, and style prompts |
Endpoint
POST /api/v1/audio/generations
Request
{
"model": "minimax/music-2.5+",
"prompt": "upbeat synthwave with warm neon pads and a driving beat",
"instrumental": true,
"lyrics": "optional lyrics if not instrumental",
"duration_seconds": 30
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | No | Model ID (default: minimax/music-2.5+) |
prompt | string | Yes | Music style, mood, or description |
instrumental | boolean | No | Generate without vocals (default: false) |
lyrics | string | No | Custom lyrics. Cannot be used with instrumental: true |
duration_seconds | integer | No | Target duration hint 5-240s (default: 30). MiniMax ignores this — output is always ~3 min. |
Response
{
"created": 1775488202,
"model": "minimax/music-2.5+",
"data": [
{
"url": "https://...",
"duration_seconds": 186
}
]
}
The url is a time-limited CDN link (expires in ~24h). Download immediately if you need to store the file.
Generation takes 1-3 minutes. Do not set your client timeout below 200 seconds or the request will abort before the track is ready.
Payment
Same x402 flow as all BlockRun endpoints:
- Call without payment → 402 with price + payment requirements
- Sign USDC authorization locally (EIP-712)
- Call again with
X-Paymentheader → music generated + payment settled
// 402 response body
{
"error": "Payment Required",
"price": { "amount": "0.157500", "currency": "USD" },
"generation_info": {
"output_duration": "~3 minutes of audio per track",
"generation_time": "~2 minutes to generate"
},
"paymentInfo": { "network": "base", "asset": "USDC", "x402Version": 2 }
}
Usage
Via BlockRun MCP (Claude Code)
claude mcp add blockrun -s user -- npx -y @blockrun/mcp@latest
Then in Claude:
Generate an upbeat pop track with lyrics about crypto and the future
Create an instrumental ambient track for a meditation app
Limitations
- Output is always ~3 minutes — MiniMax does not support duration control
- Generation takes 1-3 minutes — do not set client timeout below 200s
- MP3 only — no WAV output currently
- 1 track per request — batching not supported
- No image reference inputs — prompt-only generation
Pricing Details
| Model | BlockRun Price |
|---|---|
| music-2.5+ | $0.1575/track (provider cost + 5% margin, $0.15 base) |
Prices in USD, paid in USDC on Base network. Minimum charge is $0.003/request.
Wallet Requirements
Funded wallet on Base mainnet. Recommended balance: $5+ for ~30 tracks.
# Check balance
python3 -c "from blockrun_llm import get_wallet_address; print(get_wallet_address())"
Troubleshooting
"Music generation timed out"
Generation can take up to 3 minutes. Increase your client timeout to at least 200 seconds.
"Payment verification failed"
Insufficient USDC balance. Check your wallet on Basescan.
"Cannot specify lyrics when instrumental=true"
Remove lyrics field or set instrumental: false.