Music Generation by Lyrics
curl --request POST \
--url https://apis.finevoice.ai/v1/music/musicgen \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "My AI Song",
"style": "pop, energetic, upbeat",
"audioId": "<string>",
"referVoice": "<string>",
"referInstrumental": "<string>",
"lyrics": "[Verse 1]\nHello world, this is FineVoice...",
"instrumental": false,
"modelVersion": "v3"
}
'import requests
url = "https://apis.finevoice.ai/v1/music/musicgen"
payload = {
"title": "My AI Song",
"style": "pop, energetic, upbeat",
"audioId": "<string>",
"referVoice": "<string>",
"referInstrumental": "<string>",
"lyrics": "[Verse 1]
Hello world, this is FineVoice...",
"instrumental": False,
"modelVersion": "v3"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'My AI Song',
style: 'pop, energetic, upbeat',
audioId: '<string>',
referVoice: '<string>',
referInstrumental: '<string>',
lyrics: '[Verse 1]\nHello world, this is FineVoice...',
instrumental: false,
modelVersion: 'v3'
})
};
fetch('https://apis.finevoice.ai/v1/music/musicgen', 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://apis.finevoice.ai/v1/music/musicgen",
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([
'title' => 'My AI Song',
'style' => 'pop, energetic, upbeat',
'audioId' => '<string>',
'referVoice' => '<string>',
'referInstrumental' => '<string>',
'lyrics' => '[Verse 1]
Hello world, this is FineVoice...',
'instrumental' => false,
'modelVersion' => 'v3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://apis.finevoice.ai/v1/music/musicgen"
payload := strings.NewReader("{\n \"title\": \"My AI Song\",\n \"style\": \"pop, energetic, upbeat\",\n \"audioId\": \"<string>\",\n \"referVoice\": \"<string>\",\n \"referInstrumental\": \"<string>\",\n \"lyrics\": \"[Verse 1]\\nHello world, this is FineVoice...\",\n \"instrumental\": false,\n \"modelVersion\": \"v3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://apis.finevoice.ai/v1/music/musicgen")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My AI Song\",\n \"style\": \"pop, energetic, upbeat\",\n \"audioId\": \"<string>\",\n \"referVoice\": \"<string>\",\n \"referInstrumental\": \"<string>\",\n \"lyrics\": \"[Verse 1]\\nHello world, this is FineVoice...\",\n \"instrumental\": false,\n \"modelVersion\": \"v3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.finevoice.ai/v1/music/musicgen")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"My AI Song\",\n \"style\": \"pop, energetic, upbeat\",\n \"audioId\": \"<string>\",\n \"referVoice\": \"<string>\",\n \"referInstrumental\": \"<string>\",\n \"lyrics\": \"[Verse 1]\\nHello world, this is FineVoice...\",\n \"instrumental\": false,\n \"modelVersion\": \"v3\"\n}"
response = http.request(request)
puts response.read_body{}Music Generation
Music Generation
Generate a full music track with vocals and/or instrumentation from lyrics, style description, and reference tracks.
POST
/
v1
/
music
/
musicgen
Music Generation by Lyrics
curl --request POST \
--url https://apis.finevoice.ai/v1/music/musicgen \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "My AI Song",
"style": "pop, energetic, upbeat",
"audioId": "<string>",
"referVoice": "<string>",
"referInstrumental": "<string>",
"lyrics": "[Verse 1]\nHello world, this is FineVoice...",
"instrumental": false,
"modelVersion": "v3"
}
'import requests
url = "https://apis.finevoice.ai/v1/music/musicgen"
payload = {
"title": "My AI Song",
"style": "pop, energetic, upbeat",
"audioId": "<string>",
"referVoice": "<string>",
"referInstrumental": "<string>",
"lyrics": "[Verse 1]
Hello world, this is FineVoice...",
"instrumental": False,
"modelVersion": "v3"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'My AI Song',
style: 'pop, energetic, upbeat',
audioId: '<string>',
referVoice: '<string>',
referInstrumental: '<string>',
lyrics: '[Verse 1]\nHello world, this is FineVoice...',
instrumental: false,
modelVersion: 'v3'
})
};
fetch('https://apis.finevoice.ai/v1/music/musicgen', 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://apis.finevoice.ai/v1/music/musicgen",
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([
'title' => 'My AI Song',
'style' => 'pop, energetic, upbeat',
'audioId' => '<string>',
'referVoice' => '<string>',
'referInstrumental' => '<string>',
'lyrics' => '[Verse 1]
Hello world, this is FineVoice...',
'instrumental' => false,
'modelVersion' => 'v3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://apis.finevoice.ai/v1/music/musicgen"
payload := strings.NewReader("{\n \"title\": \"My AI Song\",\n \"style\": \"pop, energetic, upbeat\",\n \"audioId\": \"<string>\",\n \"referVoice\": \"<string>\",\n \"referInstrumental\": \"<string>\",\n \"lyrics\": \"[Verse 1]\\nHello world, this is FineVoice...\",\n \"instrumental\": false,\n \"modelVersion\": \"v3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://apis.finevoice.ai/v1/music/musicgen")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My AI Song\",\n \"style\": \"pop, energetic, upbeat\",\n \"audioId\": \"<string>\",\n \"referVoice\": \"<string>\",\n \"referInstrumental\": \"<string>\",\n \"lyrics\": \"[Verse 1]\\nHello world, this is FineVoice...\",\n \"instrumental\": false,\n \"modelVersion\": \"v3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.finevoice.ai/v1/music/musicgen")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"My AI Song\",\n \"style\": \"pop, energetic, upbeat\",\n \"audioId\": \"<string>\",\n \"referVoice\": \"<string>\",\n \"referInstrumental\": \"<string>\",\n \"lyrics\": \"[Verse 1]\\nHello world, this is FineVoice...\",\n \"instrumental\": false,\n \"modelVersion\": \"v3\"\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Bearer token (API key). Format: Bearer {your_api_key}
Body
application/json
The music generation request payload.
The generated song title.
Example:
"My AI Song"
The target music style.
Example:
"pop, energetic, upbeat"
The source audio identifier.
Reference vocal track identifier or URL.
Reference instrumental track identifier or URL.
The lyrics content.
Example:
"[Verse 1]\nHello world, this is FineVoice..."
Whether to generate instrumental-only music.
Example:
false
Model version. v3: optimized for Chinese vocals and traditional styles. r2: studio recording quality with highly realistic vocals.
Available options:
v3, r2 Example:
"v3"
Response
Task accepted.
The response is of type object.
⌘I