声音复刻提交(可灵 3.0)
curl --request POST \
--url https://api.looprouter.com/general/custom-voices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_name": "my-anchor-voice",
"voice_url": "https://example.com/sample-voice.mp3"
}
'import requests
url = "https://api.looprouter.com/general/custom-voices"
payload = {
"voice_name": "my-anchor-voice",
"voice_url": "https://example.com/sample-voice.mp3"
}
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({
voice_name: 'my-anchor-voice',
voice_url: 'https://example.com/sample-voice.mp3'
})
};
fetch('https://api.looprouter.com/general/custom-voices', 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.looprouter.com/general/custom-voices",
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([
'voice_name' => 'my-anchor-voice',
'voice_url' => 'https://example.com/sample-voice.mp3'
]),
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.looprouter.com/general/custom-voices"
payload := strings.NewReader("{\n \"voice_name\": \"my-anchor-voice\",\n \"voice_url\": \"https://example.com/sample-voice.mp3\"\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.looprouter.com/general/custom-voices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice_name\": \"my-anchor-voice\",\n \"voice_url\": \"https://example.com/sample-voice.mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/general/custom-voices")
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 \"voice_name\": \"my-anchor-voice\",\n \"voice_url\": \"https://example.com/sample-voice.mp3\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"request_id": "<string>",
"data": {
"task_id": "<string>",
"task_status": "submitted",
"task_status_msg": "<string>",
"task_result": {
"voices": [
{
"voice_id": "<string>",
"voice_name": "<string>",
"trial_url": "<string>",
"owned_by": "<string>"
}
]
},
"created_at": 123,
"updated_at": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}可灵系列
声音复刻提交(可灵 3.0)
提交可灵 3.0 声音复刻任务:用一段音源克隆音色,产出可复用的 voice_id(可作数字人的 audio_id)。请求体是扁平结构,计费模型固定 kling-3.0-voice,按次计费(非视频,无预扣 回收)。查询走 GET /general/custom-voices/。
POST
/
general
/
custom-voices
声音复刻提交(可灵 3.0)
curl --request POST \
--url https://api.looprouter.com/general/custom-voices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_name": "my-anchor-voice",
"voice_url": "https://example.com/sample-voice.mp3"
}
'import requests
url = "https://api.looprouter.com/general/custom-voices"
payload = {
"voice_name": "my-anchor-voice",
"voice_url": "https://example.com/sample-voice.mp3"
}
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({
voice_name: 'my-anchor-voice',
voice_url: 'https://example.com/sample-voice.mp3'
})
};
fetch('https://api.looprouter.com/general/custom-voices', 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.looprouter.com/general/custom-voices",
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([
'voice_name' => 'my-anchor-voice',
'voice_url' => 'https://example.com/sample-voice.mp3'
]),
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.looprouter.com/general/custom-voices"
payload := strings.NewReader("{\n \"voice_name\": \"my-anchor-voice\",\n \"voice_url\": \"https://example.com/sample-voice.mp3\"\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.looprouter.com/general/custom-voices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice_name\": \"my-anchor-voice\",\n \"voice_url\": \"https://example.com/sample-voice.mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.looprouter.com/general/custom-voices")
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 \"voice_name\": \"my-anchor-voice\",\n \"voice_url\": \"https://example.com/sample-voice.mp3\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"message": "SUCCEED",
"request_id": "<string>",
"data": {
"task_id": "<string>",
"task_status": "submitted",
"task_status_msg": "<string>",
"task_result": {
"voices": [
{
"voice_id": "<string>",
"voice_name": "<string>",
"trial_url": "<string>",
"owned_by": "<string>"
}
]
},
"created_at": 123,
"updated_at": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"type": "BadRequest"
}
}