curl --request POST \
--url https://api.cartesia.ai/voices/clone \
--header 'Cartesia-Version: <cartesia-version>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form clip=@example-file \
--form 'name=<string>' \
--form tagline= \
--form 'description=<string>' \
--form enhance=trueimport requests
url = "https://api.cartesia.ai/voices/clone"
files = { "clip": ("example-file", open("example-file", "rb")) }
payload = {
"name": "<string>",
"tagline": "",
"description": "<string>",
"enhance": "true"
}
headers = {
"Cartesia-Version": "<cartesia-version>",
"X-API-Key": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('clip', '<string>');
form.append('name', '<string>');
form.append('tagline', '');
form.append('description', '<string>');
form.append('enhance', 'true');
const options = {
method: 'POST',
headers: {'Cartesia-Version': '<cartesia-version>', 'X-API-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.cartesia.ai/voices/clone', 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.cartesia.ai/voices/clone",
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=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Cartesia-Version: <cartesia-version>",
"Content-Type: multipart/form-data",
"X-API-Key: <api-key>"
],
]);
$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.cartesia.ai/voices/clone"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cartesia-Version", "<cartesia-version>")
req.Header.Add("X-API-Key", "<api-key>")
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.cartesia.ai/voices/clone")
.header("Cartesia-Version", "<cartesia-version>")
.header("X-API-Key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cartesia.ai/voices/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Cartesia-Version"] = '<cartesia-version>'
request["X-API-Key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"is_public": true,
"name": "<string>",
"tagline": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"language": "en"
}ボイスをクローンする
curl --request POST \
--url https://api.cartesia.ai/voices/clone \
--header 'Cartesia-Version: <cartesia-version>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form clip=@example-file \
--form 'name=<string>' \
--form tagline= \
--form 'description=<string>' \
--form enhance=trueimport requests
url = "https://api.cartesia.ai/voices/clone"
files = { "clip": ("example-file", open("example-file", "rb")) }
payload = {
"name": "<string>",
"tagline": "",
"description": "<string>",
"enhance": "true"
}
headers = {
"Cartesia-Version": "<cartesia-version>",
"X-API-Key": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('clip', '<string>');
form.append('name', '<string>');
form.append('tagline', '');
form.append('description', '<string>');
form.append('enhance', 'true');
const options = {
method: 'POST',
headers: {'Cartesia-Version': '<cartesia-version>', 'X-API-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.cartesia.ai/voices/clone', 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.cartesia.ai/voices/clone",
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=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Cartesia-Version: <cartesia-version>",
"Content-Type: multipart/form-data",
"X-API-Key: <api-key>"
],
]);
$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.cartesia.ai/voices/clone"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cartesia-Version", "<cartesia-version>")
req.Header.Add("X-API-Key", "<api-key>")
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.cartesia.ai/voices/clone")
.header("Cartesia-Version", "<cartesia-version>")
.header("X-API-Key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cartesia.ai/voices/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Cartesia-Version"] = '<cartesia-version>'
request["X-API-Key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; 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=\"tagline\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"enhance\"\r\n\r\ntrue\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"is_public": true,
"name": "<string>",
"tagline": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"language": "en"
}承認
ヘッダー
API version header.
2024-06-10 "2024-06-10"
ボディ
See Clone Voices for guidance on choosing a clip.
Supported audio formats: flac, mp3, mpeg, mpga, oga, ogg, wav, webm
The name of the voice.
The language of the voice.
en, fr, de, es, pt, zh, ja, hi, it, ko, nl, pl, ru, sv, tr A few words describing the voice. At most 32 characters.
A description for the voice, typically longer than the tagline if both are provided.
No longer used
similarity, stability Whether to apply AI enhancements to the clip to reduce background noise. This leads to cleaner generated speech at the cost of reduced similarity to the source clip.
レスポンス
The ID of the voice.
The ID of the user who owns the voice.
Whether the voice is publicly accessible.
The name of the voice.
A few words describing the voice.
A description for the voice, typically longer than the tagline if both are provided.
The date and time the voice was created.
The voice's language, as an ISO 639-1 code (e.g. en, fr, zh)
"en"
このページは役に立ちましたか?