Перейти к содержимому

Create music

POST
/audio/music
curl --request POST \
--url https://example.com/audio/music \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "suno", "prompt": "lo-fi hip-hop, rain outside the window, calm" }'

Async music generation (job+poll). Suno (model “suno”) returns 2 tracks; Lyria (“lyria”/“lyria-pro”) returns 1 instrumental track. Poll GET /audio/music/{id} until status=completed, then GET …/content?index=N for the mp3.

Media typeapplication/json
MusicCreateRequest
object
model
Model

Suno / suno-v5 (song with vocals, 2 tracks) or lyria / lyria-pro (instrumental, 1 track).

string
default: suno
prompt
Any of:
string
<= 5000 characters
mode
Mode

Suno: simple (from prompt) | custom (from lyrics+style+title). Ignored by Lyria.

string
default: simple
lyrics
Any of:
string
<= 5000 characters
style
Style

Suno custom: genre, style, tags.

string
"" <= 500 characters
title
Title

Suno custom: track title.

string
"" <= 200 characters
Example
{
"model": "suno",
"prompt": "lo-fi hip-hop, rain outside the window, calm"
}

Successful Response

Media typeapplication/json
Examplegenerated
example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}