BlockRun
Get started

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

ModelPriceNotes
minimax/music-2.5+$0.1575MiniMax 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

FieldTypeRequiredDescription
modelstringNoModel ID (default: minimax/music-2.5+)
promptstringYesMusic style, mood, or description
instrumentalbooleanNoGenerate without vocals (default: false)
lyricsstringNoCustom lyrics. Cannot be used with instrumental: true
duration_secondsintegerNoTarget 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.

Set a long client timeout

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:

  1. Call without payment → 402 with price + payment requirements
  2. Sign USDC authorization locally (EIP-712)
  3. Call again with X-Payment header → 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

ModelBlockRun 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.

What's next?