Skip to main content
POST
/
v3
/
music
/
generate
V3 Generate Music
curl --request POST \
  --url https://api.topmediai.com/v3/music/generate \
  --header 'Content-Type: application/json' \
  --data '{
  "action": "<string>",
  "style": "Happy songs",
  "mv": "v3.5",
  "instrumental": 0,
  "gender": "male"
}'
"<any>"

Headers

x-api-key
string

Body

application/json
  • AutoGenerateRequest
  • CustomGenerateRequest
  • ExtendGenerateRequest
  • ConcatGenerateRequest
  • UploadGenerateRequest
  • UploadExtendGenerateRequest
  • ArtistGenerateRequest
action
string
required

Generate songs based on input description words, creating songs of different styles according to the provided description words.

Allowed value: "auto"
style
string | null

The prompt parameter is used to control the melody, tune, style, and so on of the entire song.

Example:

"Happy songs"

mv
enum<string>

v4.5-plus: Generates songs up to 8 minutes long and supports lyrics inputs of up to 5,000 words. Leveraging the latest and most powerful music generation models, it delivers richer sound quality and faster generation speeds. v4.5: Generates songs up to 8 minutes long and supports lyrics inputs of up to 5,000 words. It boasts studio-quality sound, optimal genre fusion, and faster generation speeds. v4.0: Generates songs up to 4 minutes long and supports lyrics inputs of up to 3,000 words. Songs are more vivid and sound better. v3.5: Generates songs up to 4 minutes long and supports lyrics inputs of up to 3,000 words. Songs are smoother and more engaging. v3.0: Generates songs up to 2 minutes long and supports lyrics inputs of up to 1,000 words.

The credit deduction rules for song generation with different models are as follows: When using the V3.0/V3.5/V4.0 models, 2 credits will be deducted each time 2 songs are generated; when using the V4.5/V4.5 Plus models, 3 credits will be deducted each time 2 songs are generated.

Available options:
v4.5-plus,
v4.5,
v4.0,
v3.5,
v3.0
Example:

"v3.5"

instrumental
integer | null
default:0

The instrumental parameter is used to control whether the song is pure music or not. When instrumental is set to 1, the lyrics parameter will not be applied, even if it is included in your request

Required range: 0 <= x <= 1
Example:

0

gender
enum<string> | null

Voice gender preference, used to control the gender of the singer.

Available options:
male,
female,

Response

Successful Response

The response is of type any.