Skip to main content
POST
/
v2
/
submit
V2 Generate Music
curl --request POST \
  --url https://api.topmediai.com/v2/submit \
  --header 'Content-Type: application/json' \
  --data '{
  "is_auto": 1,
  "model_version": "v3.5",
  "prompt": "Happy songs",
  "lyrics": "Enter the lyrics you'\''ve created",
  "title": "AI Music",
  "instrumental": 0,
  "continue_at": 0,
  "continue_song_id": ""
}'
"<any>"

Headers

x-api-key
string

Body

application/json
is_auto
integer
required

is_auto is used to control the use of custom mode or description mode:

  1. is_auto is 1: Description mode, will only use the request parameters prompt and model_version, even if you pass other parameters, such as lyrics, title, etc., we will not apply them.
  2. is_auto is 0: Custom mode, we will apply all parameters to the generation task, including the updated extended song parameters.
Required range: 0 <= x <= 1
Example:

1

model_version
enum<string>
required

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.

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

"v3.5"

prompt
string
required

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

Required string length: 1 - 180
Example:

"Happy songs"

lyrics
string | null
default:""

The lyrics parameter controls what the song is about.

Example:

"Enter the lyrics you've created"

title
string | null
default:""

Create a title for the song you're writing.

Maximum length: 80
Example:

"AI Music"

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

continue_at
integer | null
default:0

The continue_at field is used to implement the song extension functionality. This parameter controls the time, in seconds, at which the extended song is enabled. Note that when using the extension function, the continue_at parameter must not be 0 or exceed the song duration, otherwise the request will be considered a failure and used in conjunction with continue_song_id.

Example:

0

continue_song_id
string | null
default:""

The continue_song_id field is used to extend the song. This parameter tells us which song you want to extend, and is used in conjunction with continue_at.

Example:

""

Response

Successful Response

The response is of type any.