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
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Music description or lyrics (1–5,000 characters) |
model | string | Yes | The model identifier (see available models below) |
webhookUrl | string | No | URL to receive webhook notifications |
webhookEvents | string[] | No | Events: "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
| Model | Identifier | Description |
|---|---|---|
| Suno | "suno" | Text-to-music and lyrics-to-music generation |
Error responses
| Status | Error | Meaning |
|---|---|---|
400 | Validation error | Invalid parameters |
401 | Unauthorized | Missing or invalid API key |
402 | Insufficient credits | Not enough credits |
503 | Service unavailable | Queue temporarily down |