curl -X POST "https://mvp.tryunsora.com/api/v1/music-generations/create" \
-H "Authorization: Bearer uns_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lyrics": "[Verse]\nNeon rain falls on the city street\nI hear your voice in the midnight heat",
"prompt": "r&b, slow, passionate, male vocal",
"model": "auto",
"output_format": "mp3"
}'
{
"success": true,
"generation": {
"id": "<string>",
"status": "<string>"
},
"creditsDeducted": 123,
"creditsRemaining": 123
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}Music generator
Create song
Queue a Mureka AI music generation job from lyrics and a style prompt, then poll until your finished tracks are ready to stream or download.
POST
/
music-generations
/
create
curl -X POST "https://mvp.tryunsora.com/api/v1/music-generations/create" \
-H "Authorization: Bearer uns_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lyrics": "[Verse]\nNeon rain falls on the city street\nI hear your voice in the midnight heat",
"prompt": "r&b, slow, passionate, male vocal",
"model": "auto",
"output_format": "mp3"
}'
{
"success": true,
"generation": {
"id": "<string>",
"status": "<string>"
},
"creditsDeducted": 123,
"creditsRemaining": 123
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}Creates a music generation job powered by Mureka AI on WaveSpeed. Credits are deducted when the job is queued. Poll Poll music status with the returned
generation.id until status is COMPLETED or FAILED.
For the dashboard UI (models, lyrics, playback, and the global player), see Music generator and Playback & player.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer uns_* API key or Clerk JWT |
Idempotency-Key | No | Max 128 chars. Replays the same response for 24h on API key requests |
Content-Type | Yes | application/json |
Request body
Song lyrics. Required for song models (
auto, mureka-9, mureka-8, mureka-o2, mureka-7.6). Max 3000 characters.Style prompt — genre, mood, tempo, vocal style. Max 1024 characters. Optional for song models;
mureka-7.5 needs a prompt or lyrics.Model key. Default:
auto (Mureka V9).model | Display name | Credits | Notes |
|---|---|---|---|
auto | Mureka V9 (Auto) | 3 | Full song with lyrics |
mureka-9 | Mureka V9 | 3 | Full song with lyrics |
mureka-8 | Mureka V8 | 3 | Full song with lyrics |
mureka-o2 | Mureka O2 | 6 | Full song with lyrics |
mureka-7.6 | Mureka V7.6 | 4 | Full song with lyrics |
mureka-7.5 | Mureka V7.5 (BGM) | 4 | Instrumental background music |
Async completion
Poll Poll music status withgeneration.id until status is COMPLETED or FAILED. Webhooks are not supported on the public API.
Response
{
"success": true,
"generation": {
"id": "cm123abc",
"status": "QUEUED"
},
"creditsDeducted": 3,
"creditsRemaining": 97
}
Example
curl -X POST "https://mvp.tryunsora.com/api/v1/music-generations/create" \
-H "Authorization: Bearer uns_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lyrics": "[Verse]\nNeon rain falls on the city street\nI hear your voice in the midnight heat",
"prompt": "r&b, slow, passionate, male vocal",
"model": "auto",
"output_format": "mp3"
}'
Errors
| HTTP | When |
|---|---|
400 | Missing lyrics (song models), missing both prompt and lyrics, text too long, or an invalid model or output format |
401 | Invalid auth |
402 | Insufficient credits |
404 | User not found |
429 | Rate limit exceeded |
500 | Server error |
Authorizations
Headers
API key requests only. Retrying with the same key within 24 hours replays the first response (with the Idempotent-Replayed: true header) instead of charging again. The body isn't compared; reusing the key on a different endpoint returns 409 IDEMPOTENCY_CONFLICT. Keys over 128 characters are ignored.
Maximum string length:
128Body
application/json
Send lyrics for every model except mureka-7.5, which makes background music from prompt (or lyrics). Credits per run: auto, mureka-9 and mureka-8 3; mureka-7.6 and mureka-7.5 4; mureka-o2 6.

