Music Generation API
Generate AI-composed music tracks from text prompts. Supports instrumental and vocal tracks with custom lyrics. Powered by MiniMax Music models.
Base URL: https://api.jarvisclaw.ai/v1
Endpoints
POST /v1/audio/generations
Generate a music track from a text prompt.
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model identifier (e.g. "minimax/music-2.5") |
| prompt | string | Yes | Description of the music to generate (genre, mood, tempo) |
| instrumental | boolean | No | Generate instrumental only (no vocals) (default: false) |
| lyrics | string | No | Custom lyrics for the track (ignored if instrumental is true) |
| duration_seconds | integer | No | Target duration in seconds (max 180) (default: 180) |
Request
json
{
"model": "minimax/music-2.5",
"prompt": "Upbeat electronic dance track with synth arpeggios and driving bass",
"instrumental": true,
"duration_seconds": 120
}Response
json
{
"data": [
{
"url": "https://cdn.jarvisclaw.ai/audio/mus_abc123.mp3",
"duration_seconds": 118,
"lyrics": null
}
]
}Pricing
| Model | Price | Notes |
|---|---|---|
| minimax/music-2.5 | $0.1575/track | Up to ~3 minutes output |
Code Examples
bash
curl -X POST https://api.jarvisclaw.ai/v1/audio/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax/music-2.5",
"prompt": "Chill lo-fi hip hop beat with rain sounds",
"instrumental": true,
"duration_seconds": 120
}'python
from jarvisclaw import AudioClient
audio = AudioClient(api_key="sk-your-api-key")
# Smart route (auto-selects best model)
result = audio.music("Chill lo-fi hip hop beat with rain sounds", instrumental=True)
print(f"Track URL: {result.url}")
# With explicit model
result = audio.music("Chill lo-fi hip hop beat with rain sounds",
model="minimax/music-2.5", instrumental=True)
print(f"Track URL: {result.url}")python
from jarvisclaw import AudioClient
# ─── Option A: Base chain (EVM) ───
# Hex private key → USDC on Base (Chain ID 8453)
audio = AudioClient(private_key="0x<evm-private-key>")
# ─── Option B: Solana ───
# Base58 keypair → USDC SPL on Solana mainnet
# audio = AudioClient(private_key="<solana-bs58-keypair>")
# SDK auto-detects chain from key format — no config needed
# Smart route (auto-selects best model)
result = audio.music("Chill lo-fi hip hop beat with rain sounds", instrumental=True)
print(f"Track URL: {result.url}")
# With explicit model
result = audio.music("Chill lo-fi hip hop beat",
model="minimax/music-2.5", instrumental=True)
print(f"Track URL: {result.url}")go
package main
import (
"context"
"fmt"
jc "github.com/api-jarvisclaw/go-sdk"
)
func main() {
ctx := context.Background()
ac, _ := jc.NewAudioClient(jc.WithAPIKey("sk-your-api-key"))
// Smart route (auto-selects best model)
result, _ := ac.Music(ctx, "Chill lo-fi hip hop beat with rain sounds",
jc.WithInstrumental(true))
fmt.Printf("Track URL: %s\n", result.URL)
// With explicit model
result, _ = ac.Music(ctx, "Chill lo-fi hip hop beat with rain sounds",
jc.WithModel("minimax/music-2.5"), jc.WithInstrumental(true))
fmt.Printf("Track URL: %s\n", result.URL)
}go
package main
import (
"context"
"fmt"
jc "github.com/api-jarvisclaw/go-sdk"
)
func main() {
ctx := context.Background()
// x402 Agent wallet — pays per-call via USDC on Base (Chain ID 8453)
ac, _ := jc.NewAudioClient(jc.WithPrivateKey("0x<evm-private-key>"))
// Smart route (auto-selects best model)
result, _ := ac.Music(ctx, "Chill lo-fi hip hop beat with rain sounds",
jc.WithInstrumental(true))
fmt.Printf("Track URL: %s\n", result.URL)
// With explicit model
result, _ = ac.Music(ctx, "Chill lo-fi hip hop beat",
jc.WithModel("minimax/music-2.5"), jc.WithInstrumental(true))
fmt.Printf("Track URL: %s\n", result.URL)
}