curl --request POST \
--url https://api.voxnexus.ai/v1/tts \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"text": "Hello, this is a test message.",
"model_id": "vn-tts-basic",
"voice_id": "vn-xiaoxiao",
"language": "zh-CN",
"format": "wav",
"sample_rate": 16000,
"bit_rate": 128,
"speed": 1,
"pitch": 0,
"volume": 1,
"voice_config": {
"style": "cheerful",
"role": "Girl",
"style_degree": 0.5
}
}
'import requests
url = "https://api.voxnexus.ai/v1/tts"
payload = {
"text": "Hello, this is a test message.",
"model_id": "vn-tts-basic",
"voice_id": "vn-xiaoxiao",
"language": "zh-CN",
"format": "wav",
"sample_rate": 16000,
"bit_rate": 128,
"speed": 1,
"pitch": 0,
"volume": 1,
"voice_config": {
"style": "cheerful",
"role": "Girl",
"style_degree": 0.5
}
}
headers = {
"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: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Hello, this is a test message.',
model_id: 'vn-tts-basic',
voice_id: 'vn-xiaoxiao',
language: 'zh-CN',
format: 'wav',
sample_rate: 16000,
bit_rate: 128,
speed: 1,
pitch: 0,
volume: 1,
voice_config: {style: 'cheerful', role: 'Girl', style_degree: 0.5}
})
};
fetch('https://api.voxnexus.ai/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.voxnexus.ai/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([
'text' => 'Hello, this is a test message.',
'model_id' => 'vn-tts-basic',
'voice_id' => 'vn-xiaoxiao',
'language' => 'zh-CN',
'format' => 'wav',
'sample_rate' => 16000,
'bit_rate' => 128,
'speed' => 1,
'pitch' => 0,
'volume' => 1,
'voice_config' => [
'style' => 'cheerful',
'role' => 'Girl',
'style_degree' => 0.5
]
]),
CURLOPT_HTTPHEADER => [
"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.voxnexus.ai/v1/tts"
payload := strings.NewReader("{\n \"text\": \"Hello, this is a test message.\",\n \"model_id\": \"vn-tts-basic\",\n \"voice_id\": \"vn-xiaoxiao\",\n \"language\": \"zh-CN\",\n \"format\": \"wav\",\n \"sample_rate\": 16000,\n \"bit_rate\": 128,\n \"speed\": 1,\n \"pitch\": 0,\n \"volume\": 1,\n \"voice_config\": {\n \"style\": \"cheerful\",\n \"role\": \"Girl\",\n \"style_degree\": 0.5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.voxnexus.ai/v1/tts")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, this is a test message.\",\n \"model_id\": \"vn-tts-basic\",\n \"voice_id\": \"vn-xiaoxiao\",\n \"language\": \"zh-CN\",\n \"format\": \"wav\",\n \"sample_rate\": 16000,\n \"bit_rate\": 128,\n \"speed\": 1,\n \"pitch\": 0,\n \"volume\": 1,\n \"voice_config\": {\n \"style\": \"cheerful\",\n \"role\": \"Girl\",\n \"style_degree\": 0.5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voxnexus.ai/v1/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello, this is a test message.\",\n \"model_id\": \"vn-tts-basic\",\n \"voice_id\": \"vn-xiaoxiao\",\n \"language\": \"zh-CN\",\n \"format\": \"wav\",\n \"sample_rate\": 16000,\n \"bit_rate\": 128,\n \"speed\": 1,\n \"pitch\": 0,\n \"volume\": 1,\n \"voice_config\": {\n \"style\": \"cheerful\",\n \"role\": \"Girl\",\n \"style_degree\": 0.5\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}Text to Speech
Convert text to speech audio, returns audio data in real-time using chunked streaming by default
curl --request POST \
--url https://api.voxnexus.ai/v1/tts \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"text": "Hello, this is a test message.",
"model_id": "vn-tts-basic",
"voice_id": "vn-xiaoxiao",
"language": "zh-CN",
"format": "wav",
"sample_rate": 16000,
"bit_rate": 128,
"speed": 1,
"pitch": 0,
"volume": 1,
"voice_config": {
"style": "cheerful",
"role": "Girl",
"style_degree": 0.5
}
}
'import requests
url = "https://api.voxnexus.ai/v1/tts"
payload = {
"text": "Hello, this is a test message.",
"model_id": "vn-tts-basic",
"voice_id": "vn-xiaoxiao",
"language": "zh-CN",
"format": "wav",
"sample_rate": 16000,
"bit_rate": 128,
"speed": 1,
"pitch": 0,
"volume": 1,
"voice_config": {
"style": "cheerful",
"role": "Girl",
"style_degree": 0.5
}
}
headers = {
"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: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Hello, this is a test message.',
model_id: 'vn-tts-basic',
voice_id: 'vn-xiaoxiao',
language: 'zh-CN',
format: 'wav',
sample_rate: 16000,
bit_rate: 128,
speed: 1,
pitch: 0,
volume: 1,
voice_config: {style: 'cheerful', role: 'Girl', style_degree: 0.5}
})
};
fetch('https://api.voxnexus.ai/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.voxnexus.ai/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([
'text' => 'Hello, this is a test message.',
'model_id' => 'vn-tts-basic',
'voice_id' => 'vn-xiaoxiao',
'language' => 'zh-CN',
'format' => 'wav',
'sample_rate' => 16000,
'bit_rate' => 128,
'speed' => 1,
'pitch' => 0,
'volume' => 1,
'voice_config' => [
'style' => 'cheerful',
'role' => 'Girl',
'style_degree' => 0.5
]
]),
CURLOPT_HTTPHEADER => [
"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.voxnexus.ai/v1/tts"
payload := strings.NewReader("{\n \"text\": \"Hello, this is a test message.\",\n \"model_id\": \"vn-tts-basic\",\n \"voice_id\": \"vn-xiaoxiao\",\n \"language\": \"zh-CN\",\n \"format\": \"wav\",\n \"sample_rate\": 16000,\n \"bit_rate\": 128,\n \"speed\": 1,\n \"pitch\": 0,\n \"volume\": 1,\n \"voice_config\": {\n \"style\": \"cheerful\",\n \"role\": \"Girl\",\n \"style_degree\": 0.5\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.voxnexus.ai/v1/tts")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, this is a test message.\",\n \"model_id\": \"vn-tts-basic\",\n \"voice_id\": \"vn-xiaoxiao\",\n \"language\": \"zh-CN\",\n \"format\": \"wav\",\n \"sample_rate\": 16000,\n \"bit_rate\": 128,\n \"speed\": 1,\n \"pitch\": 0,\n \"volume\": 1,\n \"voice_config\": {\n \"style\": \"cheerful\",\n \"role\": \"Girl\",\n \"style_degree\": 0.5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voxnexus.ai/v1/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello, this is a test message.\",\n \"model_id\": \"vn-tts-basic\",\n \"voice_id\": \"vn-xiaoxiao\",\n \"language\": \"zh-CN\",\n \"format\": \"wav\",\n \"sample_rate\": 16000,\n \"bit_rate\": 128,\n \"speed\": 1,\n \"pitch\": 0,\n \"volume\": 1,\n \"voice_config\": {\n \"style\": \"cheerful\",\n \"role\": \"Girl\",\n \"style_degree\": 0.5\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}Authorizations
Authenticate using X-Api-Key header
Body
Text to convert (required)
"Hello, this is a test message."
Model identifier (required). Specifies which model to use for TTS.
"vn-tts-basic"
Voice unique identifier (required)
"vn-xiaoxiao"
Language or locale code (optional, default: "en-US"). Supports both ISO 639-1 language codes (e.g. "en", "zh") and BCP 47 locale codes (e.g. "en-US", "zh-CN"). When a language code is provided, the system will automatically resolve it to the most common locale (e.g. "en" -> "en-US").
"zh-CN"
Audio format (optional, default: wav)
wav, pcm Sample rate (optional, default: 16000)
16000, 24000, 48000 Bit rate (kbps), only valid for compressed formats (NOT SUPPORTED YET)
128
Speech rate multiplier, range: 0.5 - 2.0, default: 1.0 (optional)
0.5 <= x <= 2Pitch offset (semitones), range: -12 - 12, default: 0 (optional)
-12 <= x <= 12Volume multiplier, range: 0.0 - 1.0, default: 1.0 (optional)
0 <= x <= 1Voice-specific configuration (optional) — a flat key-value map; supported keys are listed in the voice's config_schema (GET /v1/voices/{voice_id}), unknown keys are ignored
{ "style": "cheerful", "role": "Girl", "style_degree": 0.5 }
Response
Successfully returns audio stream
The response is of type file.

