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)
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"
}

Available models

ModelIdentifierDescription
Suno"suno"Text-to-music and lyrics-to-music generation

Error responses

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

On this page