Create Voice
curl --request POST \
--url https://api.cartesia.ai/voices \
--header 'Cartesia-Version: <cartesia-version>' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"embedding": [
123
],
"base_voice_id": "<string>"
}
'import requests
url = "https://api.cartesia.ai/voices"
payload = {
"name": "<string>",
"description": "<string>",
"embedding": [123],
"base_voice_id": "<string>"
}
headers = {
"Cartesia-Version": "<cartesia-version>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Cartesia-Version': '<cartesia-version>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
embedding: [123],
base_voice_id: '<string>'
})
};
fetch('https://api.cartesia.ai/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.cartesia.ai/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([
'name' => '<string>',
'description' => '<string>',
'embedding' => [
123
],
'base_voice_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Cartesia-Version: <cartesia-version>",
"Content-Type: application/json",
"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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"embedding\": [\n 123\n ],\n \"base_voice_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cartesia-Version", "<cartesia-version>")
req.Header.Add("X-API-Key", "<api-key>")
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.cartesia.ai/voices")
.header("Cartesia-Version", "<cartesia-version>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"embedding\": [\n 123\n ],\n \"base_voice_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cartesia.ai/voices")
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["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"embedding\": [\n 123\n ],\n \"base_voice_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"is_public": true,
"name": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"language": "en"
}ボイス
ボイスを作成する
deprecated
Create voice from an embedding
POST
/
voices
Create Voice
curl --request POST \
--url https://api.cartesia.ai/voices \
--header 'Cartesia-Version: <cartesia-version>' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"embedding": [
123
],
"base_voice_id": "<string>"
}
'import requests
url = "https://api.cartesia.ai/voices"
payload = {
"name": "<string>",
"description": "<string>",
"embedding": [123],
"base_voice_id": "<string>"
}
headers = {
"Cartesia-Version": "<cartesia-version>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Cartesia-Version': '<cartesia-version>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
embedding: [123],
base_voice_id: '<string>'
})
};
fetch('https://api.cartesia.ai/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.cartesia.ai/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([
'name' => '<string>',
'description' => '<string>',
'embedding' => [
123
],
'base_voice_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Cartesia-Version: <cartesia-version>",
"Content-Type: application/json",
"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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"embedding\": [\n 123\n ],\n \"base_voice_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cartesia-Version", "<cartesia-version>")
req.Header.Add("X-API-Key", "<api-key>")
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.cartesia.ai/voices")
.header("Cartesia-Version", "<cartesia-version>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"embedding\": [\n 123\n ],\n \"base_voice_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cartesia.ai/voices")
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["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"embedding\": [\n 123\n ],\n \"base_voice_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_id": "<string>",
"is_public": true,
"name": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"language": "en"
}このエンドポイントは非推奨です。代わりに ボイスをクローンする を使用してください。
承認
ヘッダー
API version header.
利用可能なオプション:
2024-06-10 例:
"2024-06-10"
ボディ
application/json
The name of the voice.
The description of the voice.
A 192-dimensional vector (i.e. a list of 192 numbers) that represents the voice.
The language that the given voice should speak the transcript in.
利用可能なオプション:
en, fr, de, es, pt, zh, ja, hi, it, ko, nl, pl, ru, sv, tr Pull in features from a base voice, used for features like voice mixing.
レスポンス
200 - application/json
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.
The description of the voice.
The date and time the voice was created.
The voice's language, as an ISO 639-1 code (e.g. en, fr, zh)
例:
"en"
このページは役に立ちましたか?
⌘I