Text to Speech
curl --request POST \
--url https://api.voicv.com/v1/tts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"voiceId": "8c97bbb2ff424bb1a580651576774d2d",
"text": "Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.",
"format": "mp3"
}
'import requests
url = "https://api.voicv.com/v1/tts"
payload = {
"voiceId": "8c97bbb2ff424bb1a580651576774d2d",
"text": "Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.",
"format": "mp3"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voiceId: '8c97bbb2ff424bb1a580651576774d2d',
text: 'Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.',
format: 'mp3'
})
};
fetch('https://api.voicv.com/v1/tts', 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.voicv.com/v1/tts",
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([
'voiceId' => '8c97bbb2ff424bb1a580651576774d2d',
'text' => 'Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.',
'format' => 'mp3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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.voicv.com/v1/tts"
payload := strings.NewReader("{\n \"voiceId\": \"8c97bbb2ff424bb1a580651576774d2d\",\n \"text\": \"Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.\",\n \"format\": \"mp3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.voicv.com/v1/tts")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"voiceId\": \"8c97bbb2ff424bb1a580651576774d2d\",\n \"text\": \"Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.\",\n \"format\": \"mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicv.com/v1/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voiceId\": \"8c97bbb2ff424bb1a580651576774d2d\",\n \"text\": \"Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.\",\n \"format\": \"mp3\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"audioUrl": "https://r2-api.voicv.com/568e3c588b55479baf7591c17554d8f8.mp3",
"costCredits": 160
}
}OpenAPI v1
Text To Speech
Generate a speech from a text
POST
/
v1
/
tts
Text to Speech
curl --request POST \
--url https://api.voicv.com/v1/tts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"voiceId": "8c97bbb2ff424bb1a580651576774d2d",
"text": "Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.",
"format": "mp3"
}
'import requests
url = "https://api.voicv.com/v1/tts"
payload = {
"voiceId": "8c97bbb2ff424bb1a580651576774d2d",
"text": "Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.",
"format": "mp3"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voiceId: '8c97bbb2ff424bb1a580651576774d2d',
text: 'Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.',
format: 'mp3'
})
};
fetch('https://api.voicv.com/v1/tts', 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.voicv.com/v1/tts",
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([
'voiceId' => '8c97bbb2ff424bb1a580651576774d2d',
'text' => 'Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.',
'format' => 'mp3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-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.voicv.com/v1/tts"
payload := strings.NewReader("{\n \"voiceId\": \"8c97bbb2ff424bb1a580651576774d2d\",\n \"text\": \"Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.\",\n \"format\": \"mp3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.voicv.com/v1/tts")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"voiceId\": \"8c97bbb2ff424bb1a580651576774d2d\",\n \"text\": \"Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.\",\n \"format\": \"mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicv.com/v1/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voiceId\": \"8c97bbb2ff424bb1a580651576774d2d\",\n \"text\": \"Voicv is a cutting-edge voice cloning platform that transforms your voice into a digital asset in minutes, supporting multiple languages and zero-shot learning.\",\n \"format\": \"mp3\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"audioUrl": "https://r2-api.voicv.com/568e3c588b55479baf7591c17554d8f8.mp3",
"costCredits": 160
}
}Pricing
- Cost: 1 credits per character
⚠️ Important Notes
- The generated audio file will expire after 12 hours. Please download and save it promptly.
Headers
Body
application/json
⌘I