Generate AI Music (v5)
This endpoint generates instrumental AI music without vocals using advanced AI models. Available in both streaming and synchronous modes.Core Parameters
The parameters below define the request body for this API.
| Parameter | Type | Required? | Description |
|---|---|---|---|
userId | string | ✅ Required | User ID requesting the operation. |
projectId | string | ✅ Required | Project ID for organizing generations. |
prompt | string | ✅ Required | Prompt describing the music you want to generate (e.g., “Upbeat electronic dance music with synth melodies”). |
duration | integer | ⚠️ Optional | Duration in seconds. Default: 30. |
style | string | ⚠️ Optional | Musical style (e.g., “electronic”, “jazz”, “rock”, “ambient”). |
model | string | ⚠️ Optional | AI model to use. Default: mureka-7.5. |
parameters | object | ⚠️ Optional | Additional parameters for advanced customization. |
Note: This endpoint generates instrumental music only (no vocals). For songs with vocals, use the /v5/generate/song-gen endpoint instead.
Endpoints
This API provides two endpoints:- Streaming Endpoint (
/v5/generate/music-gen): Returns real-time progress updates via Server-Sent Events (SSE) - Synchronous Endpoint (
/v5/generate/music-gen/sync): Waits for completion and returns the final result
Request Body
Code Samples
- Python (Streaming)
- Python (Synchronous)
- cURL (Streaming)
- cURL (Synchronous)
- JavaScript (Streaming)
- JavaScript (Synchronous)
Response
- 200 OK (Streaming)
- 200 OK (Synchronous)
- 400 Bad Request
- 500 Internal Server Error
- 504 Gateway Timeout
isComplete: true:Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request was successful (synchronous endpoint only). |
messageId | string | Unique identifier for the generation request. |
audio_url | string | Direct URL to download/stream the generated audio. |
album_art | string | URL to the generated album artwork. |
song_name | string | Name/title of the generated music track. |
status | string | Status of the generation (e.g., “COMPLETED”, “PROCESSING”). |
content | string | Progress message (streaming endpoint only). |
isComplete | boolean | Whether generation is complete (streaming endpoint only). |
chunkIndex | integer | Current chunk index (streaming endpoint only). |
task_id | string | Task ID from the generation service (streaming endpoint only). |
Sample Output
Synchronous Response:Possible Errors
- Rate Limit Exceeded:
- Insufficient Balance:
- Invalid Prompt:
Notes
- Streaming vs Synchronous: Use the streaming endpoint (
/music-gen) for real-time progress updates, or the synchronous endpoint (/music-gen/sync) for a simple request-response pattern. - Instrumental Only: This endpoint generates instrumental music without vocals. For songs with vocals, use
/v5/generate/song-gen. - Duration: The
durationparameter controls the target length of the generated music in seconds. - Style: The
styleparameter helps guide the musical direction (e.g., “electronic”, “jazz”, “rock”, “ambient”). - Billing: This endpoint uses enterprise billing. Charges are deducted from your account balance based on the selected model and license type.

