Generate AI music programmatically. Integrate McRock's music generation engine directly into your app, game, or platform.
https://us-central1-mcrock-music.cloudfunctions.netAll requests require an API key passed in the x-api-key header. Your API key is available in Settings → API Access (Enterprise plan only).
POST /enterpriseGenerateSong HTTP/1.1
Content-Type: application/json
x-api-key: mcr_live_your_key_hereKeep your key secret. Never expose it in frontend code or public repositories. Use environment variables.
/enterpriseGenerateSongGenerates a complete song from your title and lyrics. Returns an audio URL when generation is complete (typically 30–90 seconds).
| Parameter | Type | Description |
|---|---|---|
titlerequired | string | The song title (max 80 chars) |
lyrics | string | Full lyrics. Use [Verse 1], [Chorus] labels. Required unless instrumental: true |
genre | string | One or comma-separated genres. Options: Hip-Hop R&B Indie Rock Pop Punk Alt Rock Trap Drill Electronic Synthwave Pop Neo-Soul |
vocal_gender | string | "male" or "female" |
voice_tone | string | "raspy", "smooth", or "clean" |
mood | string | "fierce", "calm", "groovy", "happy", or "sad" |
instrumental | boolean | Set true to generate music without vocals. Default: false |
webhook_url | string | If provided, McRock will POST the result to this URL when done (see Webhooks below) |
curl -X POST \
https://us-central1-mcrock-music.cloudfunctions.net/enterpriseGenerateSong \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"title": "Midnight Drive",
"lyrics": "[Verse 1]\nFlying down the highway alone...",
"genre": "Indie Rock",
"vocal_gender": "male",
"voice_tone": "raspy",
"mood": "fierce"
}'{
"success": true,
"songId": "mureka_abc123",
"title": "Midnight Drive",
"audioUrl": "https://cdn.mureka.ai/songs/abc123.mp3",
"imageUrl": "https://cdn.mureka.ai/covers/abc123.jpg",
"creditsRemaining": 19999
}/enterpriseApiStatusCheck your API key status and how many credits you have remaining.
curl \
https://us-central1-mcrock-music.cloudfunctions.net/enterpriseApiStatus \
-H "x-api-key: YOUR_API_KEY"{
"active": true,
"plan": "enterprise",
"creditsRemaining": 19999,
"totalGenerations": 1,
"customerName": "Acme Corp"
}Song generation takes 30–90 seconds. If you pass a webhook_url, McRock will POST the completed result to your server instead of making your client wait.
// McRock will POST this to your webhook_url when generation completes
{
"event": "song.completed",
"title": "Midnight Drive",
"audioUrl": "https://cdn.mureka.ai/songs/abc123.mp3",
"imageUrl": "https://cdn.mureka.ai/covers/abc123.jpg",
"songId": "mureka_abc123"
}Tip: Without a webhook, the API call blocks until the song is ready (synchronous). For production apps with many generations, use webhooks.
| Status | Error | Meaning |
|---|---|---|
| 401 | Invalid API key | The x-api-key header is missing or incorrect |
| 401 | API key is disabled | Your key was deactivated (plan canceled or suspended) |
| 401 | No credits remaining | You have used all 20,000 generation credits |
| 400 | title is required | Request body is missing the title field |
| 400 | lyrics is required | lyrics missing when instrumental is not true |
| 405 | Method not allowed | Use POST, not GET |
| 500 | Generation timed out | Music generation took too long — retry the request |
20,000
Total Credits
Per Enterprise plan (monthly)
180s
Timeout
Max wait time per generation
80 chars
Title Length
Maximum title length
Your API key is available in your Settings page on the Enterprise plan.