Speech API (Beta)
Converts text to speech using various voice models and formats.
Output formats: Format support is model-specific. Read model_spec.supported_formats and model_spec.default_format from GET /models?type=tts. Omitting response_format uses the model default; requesting an unsupported format returns HTTP 400.
Voice cloning: Some TTS models (e.g. tts-chatterbox-hd) accept a cloned-voice handle in the voice field. Mint a handle by uploading a reference audio sample to POST /v1/audio/voices, then pass the returned vv_<id> value as voice here paired with the same model. Supported voice-cloning models advertise the voice_cloning capability on GET /models?type=tts.
Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions. A 401 response with code X402_USER_NOT_ALLOWED means the wallet’s Venice account is banned or deleted, or the wallet’s x402 credit account belongs to a different user.
curl --request POST \
--url https://api.venice.ai/api/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "Hello, welcome to Venice Voice.",
"model": "tts-xai-v1",
"response_format": "mp3",
"speed": 1,
"streaming": false,
"voice": "af_sky"
}
'import requests
url = "https://api.venice.ai/api/v1/audio/speech"
payload = {
"input": "Hello, welcome to Venice Voice.",
"model": "tts-xai-v1",
"response_format": "mp3",
"speed": 1,
"streaming": False,
"voice": "af_sky"
}
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({
input: 'Hello, welcome to Venice Voice.',
model: 'tts-xai-v1',
response_format: 'mp3',
speed: 1,
streaming: false,
voice: 'af_sky'
})
};
fetch('https://api.venice.ai/api/v1/audio/speech', 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.venice.ai/api/v1/audio/speech",
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([
'input' => 'Hello, welcome to Venice Voice.',
'model' => 'tts-xai-v1',
'response_format' => 'mp3',
'speed' => 1,
'streaming' => false,
'voice' => 'af_sky'
]),
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://api.venice.ai/api/v1/audio/speech"
payload := strings.NewReader("{\n \"input\": \"Hello, welcome to Venice Voice.\",\n \"model\": \"tts-xai-v1\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"streaming\": false,\n \"voice\": \"af_sky\"\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://api.venice.ai/api/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"Hello, welcome to Venice Voice.\",\n \"model\": \"tts-xai-v1\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"streaming\": false,\n \"voice\": \"af_sky\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/v1/audio/speech")
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 \"input\": \"Hello, welcome to Venice Voice.\",\n \"model\": \"tts-xai-v1\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"streaming\": false,\n \"voice\": \"af_sky\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
Request to generate audio from text.
Optional language hint. Accepted values are model-specific: Qwen 3 accepts full names (English, Chinese, ...); xAI/ElevenLabs accept ISO 639-1 codes (en, ja, ...); MiniMax accepts full names. Unsupported values are silently ignored. Omit to let the model auto-detect.
2 - 32"English"
The model ID of a Venice TTS model.
tts-kokoro, tts-qwen3-0-6b, tts-qwen3-1-7b, tts-xai-v1, tts-inworld-1-5-max, tts-chatterbox-hd, tts-orpheus, tts-elevenlabs-turbo-v2-5, tts-minimax-speech-02-hd, tts-gemini-3-1-flash, tts-gradium-v1, tts-heygen-voice, tts-heygen-voice-turbo "tts-xai-v1"
Requested audio output format. Supported formats and the default when omitted are model-specific; see model_spec.supported_formats and model_spec.default_format from GET /models?type=tts. An explicit unsupported format returns HTTP 400.
mp3, opus, aac, flac, wav, pcm "mp3"
The voice to use when generating the audio. The maximum length is 512 characters. Voices are model-specific: Kokoro (e.g. af_sky, af_bella, am_adam), Qwen 3 (e.g. Vivian, Serena, Dylan), xAI (26 voices, e.g. eve, ara, rex, sal, leo, luna, orion, carina), Orpheus (tara, leah, jess, leo, dan, mia, zac, zoe), Inworld (Craig, Ashley, ...), Chatterbox (Aurora, Blade, ...), ElevenLabs Turbo (Rachel, Aria, ...), MiniMax (WiseWoman, DeepVoiceMan, ...), Gradium (Emma, Kent, Mia, Maximilian, Valentina, Sergio, Elise, Leo, Alice, Davi — spanning en/de/es/fr/pt). You can also pass a cloned-voice handle (vv_<id>) returned by POST /v1/audio/voices to synthesize in a previously cloned voice; the handle must be paired with the same model used to create it. Models that advertise supports_custom_voice_id (e.g. ElevenLabs) additionally accept a raw provider Voice ID here. Using an incompatible voice returns a 400 error. Call GET /models/{id} to list voices for a specific model.
512"af_sky"
Response
Audio content generated successfully
The response is of type file.
Was this page helpful?
curl --request POST \
--url https://api.venice.ai/api/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "Hello, welcome to Venice Voice.",
"model": "tts-xai-v1",
"response_format": "mp3",
"speed": 1,
"streaming": false,
"voice": "af_sky"
}
'import requests
url = "https://api.venice.ai/api/v1/audio/speech"
payload = {
"input": "Hello, welcome to Venice Voice.",
"model": "tts-xai-v1",
"response_format": "mp3",
"speed": 1,
"streaming": False,
"voice": "af_sky"
}
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({
input: 'Hello, welcome to Venice Voice.',
model: 'tts-xai-v1',
response_format: 'mp3',
speed: 1,
streaming: false,
voice: 'af_sky'
})
};
fetch('https://api.venice.ai/api/v1/audio/speech', 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.venice.ai/api/v1/audio/speech",
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([
'input' => 'Hello, welcome to Venice Voice.',
'model' => 'tts-xai-v1',
'response_format' => 'mp3',
'speed' => 1,
'streaming' => false,
'voice' => 'af_sky'
]),
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://api.venice.ai/api/v1/audio/speech"
payload := strings.NewReader("{\n \"input\": \"Hello, welcome to Venice Voice.\",\n \"model\": \"tts-xai-v1\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"streaming\": false,\n \"voice\": \"af_sky\"\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://api.venice.ai/api/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"Hello, welcome to Venice Voice.\",\n \"model\": \"tts-xai-v1\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"streaming\": false,\n \"voice\": \"af_sky\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/v1/audio/speech")
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 \"input\": \"Hello, welcome to Venice Voice.\",\n \"model\": \"tts-xai-v1\",\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"streaming\": false,\n \"voice\": \"af_sky\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}