curl --request POST \
--url https://api.goenhance.ai/api/v1/audio/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "cadence-song",
"style": "Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional",
"lyrics": "[Verse]\n晚风穿过城市的灯\n我把心事写进歌声\n\n[Chorus]\n让这首歌飞过长空\n带着思念不再沉重",
"duration": 60
}
'import requests
url = "https://api.goenhance.ai/api/v1/audio/generations"
payload = {
"model": "cadence-song",
"style": "Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional",
"lyrics": "[Verse]
晚风穿过城市的灯
我把心事写进歌声
[Chorus]
让这首歌飞过长空
带着思念不再沉重",
"duration": 60
}
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({
model: 'cadence-song',
style: 'Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional',
lyrics: '[Verse]\n晚风穿过城市的灯\n我把心事写进歌声\n\n[Chorus]\n让这首歌飞过长空\n带着思念不再沉重',
duration: 60
})
};
fetch('https://api.goenhance.ai/api/v1/audio/generations', 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.goenhance.ai/api/v1/audio/generations",
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([
'model' => 'cadence-song',
'style' => 'Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional',
'lyrics' => '[Verse]
晚风穿过城市的灯
我把心事写进歌声
[Chorus]
让这首歌飞过长空
带着思念不再沉重',
'duration' => 60
]),
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.goenhance.ai/api/v1/audio/generations"
payload := strings.NewReader("{\n \"model\": \"cadence-song\",\n \"style\": \"Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional\",\n \"lyrics\": \"[Verse]\\n晚风穿过城市的灯\\n我把心事写进歌声\\n\\n[Chorus]\\n让这首歌飞过长空\\n带着思念不再沉重\",\n \"duration\": 60\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.goenhance.ai/api/v1/audio/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"cadence-song\",\n \"style\": \"Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional\",\n \"lyrics\": \"[Verse]\\n晚风穿过城市的灯\\n我把心事写进歌声\\n\\n[Chorus]\\n让这首歌飞过长空\\n带着思念不再沉重\",\n \"duration\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/audio/generations")
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 \"model\": \"cadence-song\",\n \"style\": \"Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional\",\n \"lyrics\": \"[Verse]\\n晚风穿过城市的灯\\n我把心事写进歌声\\n\\n[Chorus]\\n让这首歌飞过长空\\n带着思念不再沉重\",\n \"duration\": 60\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5",
"cost": 1.2
}
}Cadence Song
Generate a full song, vocals and accompaniment together, from your lyrics and a style description.
durationsets the maximum length in seconds (10 to 360) and is the billed length. The song follows your lyrics: when they finish earlier, the song ends earlier. When the song reachesduration, it fades out over the last 3 seconds.- Longer lyrics need a longer
duration; roughly 60 to 90 seconds per verse and chorus. - Generation takes about as long as the requested length.
Pricing: 0.02 tokens ($0.0004) per second of audio, rounded up to the whole second.
| Option | Tokens | USD |
|---|---|---|
| Per second of audio | 0.02 | $0.0004 |
Result: one json item { "type": "audio", "value": "https://...mp3" } (a .wav link when output_format is wav), 48 kHz stereo. Result links expire (see link_expired_at).
curl --request POST \
--url https://api.goenhance.ai/api/v1/audio/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "cadence-song",
"style": "Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional",
"lyrics": "[Verse]\n晚风穿过城市的灯\n我把心事写进歌声\n\n[Chorus]\n让这首歌飞过长空\n带着思念不再沉重",
"duration": 60
}
'import requests
url = "https://api.goenhance.ai/api/v1/audio/generations"
payload = {
"model": "cadence-song",
"style": "Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional",
"lyrics": "[Verse]
晚风穿过城市的灯
我把心事写进歌声
[Chorus]
让这首歌飞过长空
带着思念不再沉重",
"duration": 60
}
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({
model: 'cadence-song',
style: 'Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional',
lyrics: '[Verse]\n晚风穿过城市的灯\n我把心事写进歌声\n\n[Chorus]\n让这首歌飞过长空\n带着思念不再沉重',
duration: 60
})
};
fetch('https://api.goenhance.ai/api/v1/audio/generations', 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.goenhance.ai/api/v1/audio/generations",
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([
'model' => 'cadence-song',
'style' => 'Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional',
'lyrics' => '[Verse]
晚风穿过城市的灯
我把心事写进歌声
[Chorus]
让这首歌飞过长空
带着思念不再沉重',
'duration' => 60
]),
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.goenhance.ai/api/v1/audio/generations"
payload := strings.NewReader("{\n \"model\": \"cadence-song\",\n \"style\": \"Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional\",\n \"lyrics\": \"[Verse]\\n晚风穿过城市的灯\\n我把心事写进歌声\\n\\n[Chorus]\\n让这首歌飞过长空\\n带着思念不再沉重\",\n \"duration\": 60\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.goenhance.ai/api/v1/audio/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"cadence-song\",\n \"style\": \"Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional\",\n \"lyrics\": \"[Verse]\\n晚风穿过城市的灯\\n我把心事写进歌声\\n\\n[Chorus]\\n让这首歌飞过长空\\n带着思念不再沉重\",\n \"duration\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/audio/generations")
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 \"model\": \"cadence-song\",\n \"style\": \"Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional\",\n \"lyrics\": \"[Verse]\\n晚风穿过城市的灯\\n我把心事写进歌声\\n\\n[Chorus]\\n让这首歌飞过长空\\n带着思念不再沉重\",\n \"duration\": 60\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5",
"cost": 1.2
}
}Headers
Body
Model name. Must be cadence-song.
cadence-song Describe the music: language, genre, instruments, vocal, mood and tempo, comma-separated works best, e.g. Mandarin pop, warm female vocal, piano, strings, 90 BPM, emotional. Max 1000 characters.
1000Lyrics to sing, with \n between lines. Section tags such as [Verse], [Chorus], [Bridge], [Intro], [Outro] are recommended. Chinese and English are supported. Max 4000 characters.
4000Required. Maximum length of the song in seconds, 10 to 360. This is the billed length: you pay for duration seconds even when the song ends earlier.
10 <= x <= 360Optional. The same seed and inputs give the same result. Random when omitted.
0 <= x <= 2147483647mp3 (320 kbps, default) or wav (16-bit). 48 kHz stereo.
mp3, wav Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.
"https://your-server.com/goenhance/callback"
