API v1 — Live

McRock API

Generate AI music programmatically. Integrate McRock's music generation engine directly into your app, game, or platform.

Base URLhttps://us-central1-mcrock-music.cloudfunctions.net
1

Authentication

All requests require an API key passed in the x-api-key header. Your API key is available in Settings → API Access (Enterprise plan only).

http
POST /enterpriseGenerateSong HTTP/1.1
Content-Type: application/json
x-api-key: mcr_live_your_key_here

Keep your key secret. Never expose it in frontend code or public repositories. Use environment variables.

2

Generate a Song

POST/enterpriseGenerateSong

Generates a complete song from your title and lyrics. Returns an audio URL when generation is complete (typically 30–90 seconds).

Request Body

ParameterTypeDescription
titlerequiredstringThe song title (max 80 chars)
lyricsstringFull lyrics. Use [Verse 1], [Chorus] labels. Required unless instrumental: true
genrestringOne or comma-separated genres. Options: Hip-Hop R&B Indie Rock Pop Punk Alt Rock Trap Drill Electronic Synthwave Pop Neo-Soul
vocal_genderstring"male" or "female"
voice_tonestring"raspy", "smooth", or "clean"
moodstring"fierce", "calm", "groovy", "happy", or "sad"
instrumentalbooleanSet true to generate music without vocals. Default: false
webhook_urlstringIf provided, McRock will POST the result to this URL when done (see Webhooks below)

Example Request

bash
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"
  }'

Response

json
{
  "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
}
3

Check API Status & Credits

GET/enterpriseApiStatus

Check your API key status and how many credits you have remaining.

bash
curl \
  https://us-central1-mcrock-music.cloudfunctions.net/enterpriseApiStatus \
  -H "x-api-key: YOUR_API_KEY"
json
{
  "active": true,
  "plan": "enterprise",
  "creditsRemaining": 19999,
  "totalGenerations": 1,
  "customerName": "Acme Corp"
}
4

Webhooks

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.

json
// 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.

5

Error Codes

StatusErrorMeaning
401Invalid API keyThe x-api-key header is missing or incorrect
401API key is disabledYour key was deactivated (plan canceled or suspended)
401No credits remainingYou have used all 20,000 generation credits
400title is requiredRequest body is missing the title field
400lyrics is requiredlyrics missing when instrumental is not true
405Method not allowedUse POST, not GET
500Generation timed outMusic generation took too long — retry the request
6

Limits

20,000

Total Credits

Per Enterprise plan (monthly)

180s

Timeout

Max wait time per generation

80 chars

Title Length

Maximum title length

Ready to integrate?

Your API key is available in your Settings page on the Enterprise plan.