Skip to main content
POST
/
music-generations
/
create
curl -X POST "https://mvp.tryunsora.com/api/v1/music-generations/create" \
  -H "Authorization: Bearer uns_live_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

HeaderRequiredDescription
AuthorizationYesBearer uns_live_* API key or Clerk JWT
Idempotency-KeyNoMax 128 chars. Replays the same response for 24h on API key requests
Content-TypeYesapplication/json

Request body

lyrics
string
required
Song lyrics. Required for song models (auto, mureka-9, mureka-8, mureka-o2, mureka-7.6). Max 3000 characters.
prompt
string
required
Style prompt — genre, mood, tempo, vocal style. Max 1024 characters.
model
string
Model key. Default: auto (Mureka V9).
modelDisplay nameCreditsNotes
autoMureka V9 (Auto)5Full song with lyrics
mureka-9Mureka V95Full song with lyrics
mureka-8Mureka V85Full song with lyrics
mureka-o2Mureka O26Full song with lyrics
mureka-7.6Mureka V7.64Full song with lyrics
mureka-7.5Mureka V7.5 (BGM)4Instrumental background music
output_format
string
Output audio format: mp3, wav, or flac. Default: mp3.

Async completion

Poll Poll music status with generation.id until status is COMPLETED or FAILED. Webhooks are not supported on the public API.

Response

{
  "success": true,
  "generation": {
    "id": "cm123abc",
    "status": "QUEUED"
  },
  "creditsDeducted": 5,
  "creditsRemaining": 95
}

Example

curl -X POST "https://mvp.tryunsora.com/api/v1/music-generations/create" \
  -H "Authorization: Bearer uns_live_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

HTTPWhen
400Missing/invalid lyrics, prompt, model, or output format
401Invalid auth
402Insufficient credits
404User not found
429Rate limit exceeded
500Server error

Authorizations

Authorization
string
header
required

Clerk session JWT or Unsora API key (uns_live_*)

Headers

Idempotency-Key
string

Optional. Replays the original response for 24h when using an API key.

Maximum string length: 128

Body

application/json
prompt
string
required

Style prompt — genre, mood, vocal style (up to 1024 chars)

lyrics
string

Song lyrics (required for song models, up to 3000 chars)

model
string
default:auto

Model key: auto, mureka-9, mureka-8, mureka-o2, mureka-7.6, mureka-7.5

output_format
enum<string>
default:mp3
Available options:
mp3,
wav,
flac

Response

Job queued

success
boolean
required
generation
object
required
creditsDeducted
number
required
creditsRemaining
number
required