生成音效
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "generate-sounds",
"input": {
"prompt": "Rain and distant thunder",
"mv": "V5_5",
"sound_loop": true,
"sound_tempo": 90,
"sound_key": "Cm",
"grab_lyrics": false
}
}
'import requests
url = "https://api.poyo.ai/api/generate/submit"
payload = {
"model": "generate-sounds",
"input": {
"prompt": "Rain and distant thunder",
"mv": "V5_5",
"sound_loop": True,
"sound_tempo": 90,
"sound_key": "Cm",
"grab_lyrics": False
}
}
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({
model: 'generate-sounds',
input: {
prompt: 'Rain and distant thunder',
mv: 'V5_5',
sound_loop: true,
sound_tempo: 90,
sound_key: 'Cm',
grab_lyrics: false
}
})
};
fetch('https://api.poyo.ai/api/generate/submit', 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.poyo.ai/api/generate/submit",
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' => 'generate-sounds',
'input' => [
'prompt' => 'Rain and distant thunder',
'mv' => 'V5_5',
'sound_loop' => true,
'sound_tempo' => 90,
'sound_key' => 'Cm',
'grab_lyrics' => false
]
]),
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://api.poyo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"generate-sounds\",\n \"input\": {\n \"prompt\": \"Rain and distant thunder\",\n \"mv\": \"V5_5\",\n \"sound_loop\": true,\n \"sound_tempo\": 90,\n \"sound_key\": \"Cm\",\n \"grab_lyrics\": false\n }\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://api.poyo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"generate-sounds\",\n \"input\": {\n \"prompt\": \"Rain and distant thunder\",\n \"mv\": \"V5_5\",\n \"sound_loop\": true,\n \"sound_tempo\": 90,\n \"sound_key\": \"Cm\",\n \"grab_lyrics\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai/api/generate/submit")
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 \"model\": \"generate-sounds\",\n \"input\": {\n \"prompt\": \"Rain and distant thunder\",\n \"mv\": \"V5_5\",\n \"sound_loop\": true,\n \"sound_tempo\": 90,\n \"sound_key\": \"Cm\",\n \"grab_lyrics\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "<string>",
"status": "not_started",
"created_time": "2023-11-07T05:31:56Z"
}
}Suno AI
生成音效
生成音效 API 使用 Suno V5 或 V5.5,根据文本提示词生成音效、环境声或音乐采样。速度、调式和可循环结果均为可选项。
POST
/
api
/
generate
/
submit
生成音效
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "generate-sounds",
"input": {
"prompt": "Rain and distant thunder",
"mv": "V5_5",
"sound_loop": true,
"sound_tempo": 90,
"sound_key": "Cm",
"grab_lyrics": false
}
}
'import requests
url = "https://api.poyo.ai/api/generate/submit"
payload = {
"model": "generate-sounds",
"input": {
"prompt": "Rain and distant thunder",
"mv": "V5_5",
"sound_loop": True,
"sound_tempo": 90,
"sound_key": "Cm",
"grab_lyrics": False
}
}
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({
model: 'generate-sounds',
input: {
prompt: 'Rain and distant thunder',
mv: 'V5_5',
sound_loop: true,
sound_tempo: 90,
sound_key: 'Cm',
grab_lyrics: false
}
})
};
fetch('https://api.poyo.ai/api/generate/submit', 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.poyo.ai/api/generate/submit",
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' => 'generate-sounds',
'input' => [
'prompt' => 'Rain and distant thunder',
'mv' => 'V5_5',
'sound_loop' => true,
'sound_tempo' => 90,
'sound_key' => 'Cm',
'grab_lyrics' => false
]
]),
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://api.poyo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"generate-sounds\",\n \"input\": {\n \"prompt\": \"Rain and distant thunder\",\n \"mv\": \"V5_5\",\n \"sound_loop\": true,\n \"sound_tempo\": 90,\n \"sound_key\": \"Cm\",\n \"grab_lyrics\": false\n }\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://api.poyo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"generate-sounds\",\n \"input\": {\n \"prompt\": \"Rain and distant thunder\",\n \"mv\": \"V5_5\",\n \"sound_loop\": true,\n \"sound_tempo\": 90,\n \"sound_key\": \"Cm\",\n \"grab_lyrics\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai/api/generate/submit")
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 \"model\": \"generate-sounds\",\n \"input\": {\n \"prompt\": \"Rain and distant thunder\",\n \"mv\": \"V5_5\",\n \"sound_loop\": true,\n \"sound_tempo\": 90,\n \"sound_key\": \"Cm\",\n \"grab_lyrics\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "<string>",
"status": "not_started",
"created_time": "2023-11-07T05:31:56Z"
}
}mv 使用 V5、V5_5、V6、V6_MINI 或 V6_WILD。sound_tempo 为 1–300 BPM 的整数;sound_key 接受大调/小调,例如 C、F#、Am 或 C#m。设置 sound_loop 可获得可循环的结果;提示词包含人声素材时设置 grab_lyrics。
{"model":"generate-sounds","input":{"prompt":"Rain on a metal roof with distant thunder","mv":"V5_5","sound_loop":true,"sound_tempo":90,"sound_key":"Cm","grab_lyrics":false}}
授权
所有 API 接口都需要 Bearer Token 认证。
创建 API Key:登录 PoYo,进入 仪表盘 → API 密钥(poyo.ai/zh/dashboard/api-key),点击创建 Key。
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
响应
200 - application/json
已提交
Show child attributes
Show child attributes