Create cloned voice
curl --request POST \
--url https://supertoneapi.com/v1/custom-voices/cloned-voice \
--header 'Content-Type: multipart/form-data' \
--header 'x-sup-api-key: <api-key>' \
--form files='@example-file' \
--form 'name=<string>' \
--form 'description=<string>'import requests
url = "https://supertoneapi.com/v1/custom-voices/cloned-voice"
files = { "files": ("example-file", open("example-file", "rb")) }
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {"x-sup-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('name', '<string>');
form.append('description', '<string>');
const options = {method: 'POST', headers: {'x-sup-api-key': '<api-key>'}};
options.body = form;
fetch('https://supertoneapi.com/v1/custom-voices/cloned-voice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://supertoneapi.com/v1/custom-voices/cloned-voice"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-sup-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://supertoneapi.com/v1/custom-voices/cloned-voice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-sup-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://supertoneapi.com/v1/custom-voices/cloned-voice")
.header("x-sup-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();{
"voice_id": "voice_123456789"
}{
"status": "error",
"message": "Invalid request data"
}{
"status": "error",
"message": {
"message": "Invalid API Key",
"error": "Unauthorized"
}
}{
"status": "error",
"message": {
"message": "Permission denied",
"error": "Forbidden"
}
}{
"status": "error",
"message": {
"message": "Voice not found",
"error": "Not Found"
}
}{
"status": "error",
"message": {
"message": "File too large",
"error": "Payload Too Large"
}
}{
"status": "error",
"message": "Unsupported audio format. Supported formats: WAV, MP3. Received: application/json"
}{
"status": "error",
"message": {
"message": "rate limit exceeded",
"error": "Too Many Requests"
}
}{
"status": "error",
"message": {
"message": "Failed to convert text to speech",
"error": "Internal Server Error"
}
}Custom voices
Create cloned voice
サンプル音声ファイルをアップロードして新しいカスタムボイスを登録します。
POST
/
v1
/
custom-voices
/
cloned-voice
Create cloned voice
curl --request POST \
--url https://supertoneapi.com/v1/custom-voices/cloned-voice \
--header 'Content-Type: multipart/form-data' \
--header 'x-sup-api-key: <api-key>' \
--form files='@example-file' \
--form 'name=<string>' \
--form 'description=<string>'import requests
url = "https://supertoneapi.com/v1/custom-voices/cloned-voice"
files = { "files": ("example-file", open("example-file", "rb")) }
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {"x-sup-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('name', '<string>');
form.append('description', '<string>');
const options = {method: 'POST', headers: {'x-sup-api-key': '<api-key>'}};
options.body = form;
fetch('https://supertoneapi.com/v1/custom-voices/cloned-voice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://supertoneapi.com/v1/custom-voices/cloned-voice"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-sup-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://supertoneapi.com/v1/custom-voices/cloned-voice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-sup-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://supertoneapi.com/v1/custom-voices/cloned-voice")
.header("x-sup-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();{
"voice_id": "voice_123456789"
}{
"status": "error",
"message": "Invalid request data"
}{
"status": "error",
"message": {
"message": "Invalid API Key",
"error": "Unauthorized"
}
}{
"status": "error",
"message": {
"message": "Permission denied",
"error": "Forbidden"
}
}{
"status": "error",
"message": {
"message": "Voice not found",
"error": "Not Found"
}
}{
"status": "error",
"message": {
"message": "File too large",
"error": "Payload Too Large"
}
}{
"status": "error",
"message": "Unsupported audio format. Supported formats: WAV, MP3. Received: application/json"
}{
"status": "error",
"message": {
"message": "rate limit exceeded",
"error": "Too Many Requests"
}
}{
"status": "error",
"message": {
"message": "Failed to convert text to speech",
"error": "Internal Server Error"
}
}このドキュメントは英語の原文から自動翻訳されています。表現に不自然な箇所がある場合があります。正確な内容は英語の原文もあわせてご確認ください。
voice_id はプリセットボイスと同じ TTS エンドポイントから直ちに呼び出せます。
API 経由の ボイスクローニングは Free プランではご利用いただけません。Free プランのアカウントでは Supertone Play でクローニングが可能です。
エンドポイント
POST https://supertoneapi.com/v1/custom-voices/cloned-voice
multipart/form-data として送信してください。
リクエストボディ
| Field | Required | Description |
|---|---|---|
files | ✅ | クローニング元の音声サンプルです。WAV または MP3、3 MB 未満 である必要があります。 |
name | ✅ | ボイス名です。最大 100 文字。 |
description | — | 自由記述の説明です。 |
サンプル品質のヒント
クローン品質を最大化するためのポイント:- 背景ノイズが少なく、話者が 1 人のクリーンな音声を使用してください。
- 5〜30 秒程度あれば十分です。
- モノラルを推奨します。サンプルレートは高くても問題ありません。
レスポンス
割り当てられたvoice_id を含む、新しいカスタムボイスオブジェクトを返します。この ID を保存し、音声生成 に渡して利用してください。
エラー
| Status | Cause |
|---|---|
400 Bad Request | files または name が欠落、もしくは name が長すぎます。 |
413 Payload Too Large | 音声ファイルが 3 MB を超えています。 |
415 Unsupported Media Type | ファイルが WAV でも MP3 でもありません。 |
403 Forbidden | Free プランのアカウントです(API 経由のクローニングは許可されていません)。 |
関連項目
Docs: Custom voices
SDK サンプル付きのライフサイクル解説。
Custom voice example
クローン作成からリスト、呼び出しまでのエンドツーエンド例。
Authorizations
Body
multipart/form-data
Audio file and voice metadata
Response
Successfully created cloned voice
Unique identifier for the created voice
Example:
"voice_123456789"
⌘I