Clone a voice from a sample
curl --request POST \
--url https://mvp.tryunsora.com/api/v1/voice-clones/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"sample_url": "<string>",
"sample_asset_id": "<string>"
}
'import requests
url = "https://mvp.tryunsora.com/api/v1/voice-clones/create"
payload = {
"name": "<string>",
"description": "<string>",
"sample_url": "<string>",
"sample_asset_id": "<string>"
}
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({
name: '<string>',
description: '<string>',
sample_url: '<string>',
sample_asset_id: '<string>'
})
};
fetch('https://mvp.tryunsora.com/api/v1/voice-clones/create', 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://mvp.tryunsora.com/api/v1/voice-clones/create",
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>',
'sample_url' => '<string>',
'sample_asset_id' => '<string>'
]),
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://mvp.tryunsora.com/api/v1/voice-clones/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sample_url\": \"<string>\",\n \"sample_asset_id\": \"<string>\"\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://mvp.tryunsora.com/api/v1/voice-clones/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sample_url\": \"<string>\",\n \"sample_asset_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mvp.tryunsora.com/api/v1/voice-clones/create")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sample_url\": \"<string>\",\n \"sample_asset_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"clone": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"sampleAsset": {},
"createdAt": "2023-11-07T05:31:56Z"
},
"creditsDeducted": 15,
"creditsRemaining": 123
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}Voice clones
Clone a voice
Make an instant clone of a voice from a recording, then use it in voiceovers, talking avatars and the voice changer. Costs 15 credits.
POST
/
voice-clones
/
create
Clone a voice from a sample
curl --request POST \
--url https://mvp.tryunsora.com/api/v1/voice-clones/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"sample_url": "<string>",
"sample_asset_id": "<string>"
}
'import requests
url = "https://mvp.tryunsora.com/api/v1/voice-clones/create"
payload = {
"name": "<string>",
"description": "<string>",
"sample_url": "<string>",
"sample_asset_id": "<string>"
}
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({
name: '<string>',
description: '<string>',
sample_url: '<string>',
sample_asset_id: '<string>'
})
};
fetch('https://mvp.tryunsora.com/api/v1/voice-clones/create', 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://mvp.tryunsora.com/api/v1/voice-clones/create",
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>',
'sample_url' => '<string>',
'sample_asset_id' => '<string>'
]),
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://mvp.tryunsora.com/api/v1/voice-clones/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sample_url\": \"<string>\",\n \"sample_asset_id\": \"<string>\"\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://mvp.tryunsora.com/api/v1/voice-clones/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sample_url\": \"<string>\",\n \"sample_asset_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mvp.tryunsora.com/api/v1/voice-clones/create")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"sample_url\": \"<string>\",\n \"sample_asset_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"clone": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"sampleAsset": {},
"createdAt": "2023-11-07T05:31:56Z"
},
"creditsDeducted": 15,
"creditsRemaining": 123
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}{
"error": "<string>",
"success": true,
"code": "<string>",
"message": "<string>"
}Clones a voice from a clear recording of one person speaking. Costs 15 credits; you can keep up to 10 clones. Use the returned
clone.id as a voice_id.
curl -X POST "https://mvp.tryunsora.com/api/v1/voice-clones/create" \
-H "Authorization: Bearer uns_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My narrator voice",
"sample_url": "https://cdn.example.com/voice-sample.mp3"
}'
Authorizations
An Unsora API key (uns_…). A Clerk session token also works.
Body
application/json

