ApiframeApiframe Docs
Music Generation

Music Generation

Generate music tracks using a variety of models through a single unified endpoint.

POST /v2/music/generate

Submit a prompt to generate a music track. In default mode, the prompt describes the kind of music you want. In custom mode, the prompt is used as lyrics.

Common request body

FieldTypeRequiredDescription
promptstringYesMusic description or lyrics (1–5,000 characters). Some models cap descriptions lower — e.g. Suno limits the prompt to 500 chars in non-custom mode. See the per-model page.
modelstringYesThe model identifier (see available models below)
webhookUrlstringNoURL to receive webhook notifications
webhookEventsstring[]NoEvents: "progress", "completed", "failed"

Each model also accepts its own parameters object — see the individual model pages for details.

Response

Status: 202 Accepted

{
  "jobId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "status": "QUEUED"
}

Result format

When the job completes, the result field on GET /v2/jobs/:id (and in the completed webhook payload) is an object with an array of generated tracks:

{
  "tracks": [
    {
      "id": "track_abc123",
      "audioUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-0.mp3",
      "imageUrl": "https://cdn2.apiframe.ai/audio/c3d4e5f6-a7b8-9012-cdef-345678901234-0.jpeg",
      "title": "Neon Skyline",
      "tags": "synthwave, electronic, upbeat",
      "duration": 184.2
    }
  ]
}
FieldTypeDescription
tracksobject[]One entry per generated track. Suno, Udio, and Producer return 2 tracks per request; Mureka returns 1–3 (murekaParams.n, default 2); Lyria and ElevenLabs Music return 1.
tracks[].idstringProvider track ID
tracks[].audioUrlstringCDN URL of the MP3 file
tracks[].imageUrlstring | nullCDN URL of the cover art, when the model returns one
tracks[].titlestring | nullGenerated track title
tracks[].tagsstring | nullStyle tags describing the track
tracks[].durationnumber | nullTrack length in seconds

Each model page shows an example result. Result files are hosted on the APIFRAME CDN for 90 days — download anything you want to keep.

Available models

ModelIdentifierDescription
Suno"suno"Text-to-music and lyrics-to-music generation
Mureka"mureka"Songs and instrumentals with custom or auto-generated lyrics

Error responses

StatusErrorMeaning
400Validation errorInvalid parameters
401UnauthorizedMissing or invalid API key
402Insufficient creditsNot enough credits
503Service unavailableQueue temporarily down

On this page