V1 Generate Music
curl --request POST \
--url https://api.topmediai.com/v1/music \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"is_auto": 1,
"prompt": "Happy songs",
"lyrics": "Enter the lyrics you've created",
"title": "Happy Songs",
"instrumental": 0
}
EOFimport requests
url = "https://api.topmediai.com/v1/music"
payload = {
"is_auto": 1,
"prompt": "Happy songs",
"lyrics": "Enter the lyrics you've created",
"title": "Happy Songs",
"instrumental": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
is_auto: 1,
prompt: 'Happy songs',
lyrics: 'Enter the lyrics you\'ve created',
title: 'Happy Songs',
instrumental: 0
})
};
fetch('https://api.topmediai.com/v1/music', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.topmediai.com/v1/music",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'is_auto' => 1,
'prompt' => 'Happy songs',
'lyrics' => 'Enter the lyrics you\'ve created',
'title' => 'Happy Songs',
'instrumental' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.topmediai.com/v1/music"
payload := strings.NewReader("{\n \"is_auto\": 1,\n \"prompt\": \"Happy songs\",\n \"lyrics\": \"Enter the lyrics you've created\",\n \"title\": \"Happy Songs\",\n \"instrumental\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.topmediai.com/v1/music")
.header("Content-Type", "application/json")
.body("{\n \"is_auto\": 1,\n \"prompt\": \"Happy songs\",\n \"lyrics\": \"Enter the lyrics you've created\",\n \"title\": \"Happy Songs\",\n \"instrumental\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topmediai.com/v1/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"is_auto\": 1,\n \"prompt\": \"Happy songs\",\n \"lyrics\": \"Enter the lyrics you've created\",\n \"title\": \"Happy Songs\",\n \"instrumental\": 0\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}AI-Music-Generator
V1 Generate Music
Use your lyrics or param to do a music and return the audio.
POST
/
v1
/
music
V1 Generate Music
curl --request POST \
--url https://api.topmediai.com/v1/music \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"is_auto": 1,
"prompt": "Happy songs",
"lyrics": "Enter the lyrics you've created",
"title": "Happy Songs",
"instrumental": 0
}
EOFimport requests
url = "https://api.topmediai.com/v1/music"
payload = {
"is_auto": 1,
"prompt": "Happy songs",
"lyrics": "Enter the lyrics you've created",
"title": "Happy Songs",
"instrumental": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
is_auto: 1,
prompt: 'Happy songs',
lyrics: 'Enter the lyrics you\'ve created',
title: 'Happy Songs',
instrumental: 0
})
};
fetch('https://api.topmediai.com/v1/music', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.topmediai.com/v1/music",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'is_auto' => 1,
'prompt' => 'Happy songs',
'lyrics' => 'Enter the lyrics you\'ve created',
'title' => 'Happy Songs',
'instrumental' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.topmediai.com/v1/music"
payload := strings.NewReader("{\n \"is_auto\": 1,\n \"prompt\": \"Happy songs\",\n \"lyrics\": \"Enter the lyrics you've created\",\n \"title\": \"Happy Songs\",\n \"instrumental\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.topmediai.com/v1/music")
.header("Content-Type", "application/json")
.body("{\n \"is_auto\": 1,\n \"prompt\": \"Happy songs\",\n \"lyrics\": \"Enter the lyrics you've created\",\n \"title\": \"Happy Songs\",\n \"instrumental\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topmediai.com/v1/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"is_auto\": 1,\n \"prompt\": \"Happy songs\",\n \"lyrics\": \"Enter the lyrics you've created\",\n \"title\": \"Happy Songs\",\n \"instrumental\": 0\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Body
application/json
Mandatory parameter, only the prompt parameter is valid if it is 1, otherwise, all parameters are valid.
Required range:
0 <= x <= 1Example:
1
Mandatory parameter, generated song style
Example:
"Happy songs"
Non-mandatory parameter, default is null
Example:
"Enter the lyrics you've created"
Non-mandatory parameter, default is null
Example:
"Happy Songs"
Non-mandatory parameter, default is 0
Required range:
0 <= x <= 1Example:
0
Response
Successful Response
⌘I
