xAI TTS 1
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/tts/v1",
"input": {
"text": "Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.",
"voice": "eve",
"language_code": "auto",
"output_format": {
"codec": "mp3",
"sample_rate": 24000,
"bit_rate": 128000
}
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "xai/tts/v1",
"input": {
"text": "Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.",
"voice": "eve",
"language_code": "auto",
"output_format": {
"codec": "mp3",
"sample_rate": 24000,
"bit_rate": 128000
}
}
}
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({
model: 'xai/tts/v1',
input: {
text: 'Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.',
voice: 'eve',
language_code: 'auto',
output_format: {codec: 'mp3', sample_rate: 24000, bit_rate: 128000}
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', 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.vidgo.ai/api/generate/submit",
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([
'model' => 'xai/tts/v1',
'input' => [
'text' => 'Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.',
'voice' => 'eve',
'language_code' => 'auto',
'output_format' => [
'codec' => 'mp3',
'sample_rate' => 24000,
'bit_rate' => 128000
]
]
]),
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.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"xai/tts/v1\",\n \"input\": {\n \"text\": \"Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.\",\n \"voice\": \"eve\",\n \"language_code\": \"auto\",\n \"output_format\": {\n \"codec\": \"mp3\",\n \"sample_rate\": 24000,\n \"bit_rate\": 128000\n }\n }\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.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"xai/tts/v1\",\n \"input\": {\n \"text\": \"Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.\",\n \"voice\": \"eve\",\n \"language_code\": \"auto\",\n \"output_format\": {\n \"codec\": \"mp3\",\n \"sample_rate\": 24000,\n \"bit_rate\": 128000\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
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 \"model\": \"xai/tts/v1\",\n \"input\": {\n \"text\": \"Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.\",\n \"voice\": \"eve\",\n \"language_code\": \"auto\",\n \"output_format\": {\n \"codec\": \"mp3\",\n \"sample_rate\": 24000,\n \"bit_rate\": 128000\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}"Request timeout"{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}xAI
xAI TTS 1
Convert text into speech with xAI TTS, choosing from five voices and multiple languages for narration, dialogue, and spoken content.
POST
/
api
/
generate
/
submit
xAI TTS 1
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/tts/v1",
"input": {
"text": "Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.",
"voice": "eve",
"language_code": "auto",
"output_format": {
"codec": "mp3",
"sample_rate": 24000,
"bit_rate": 128000
}
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "xai/tts/v1",
"input": {
"text": "Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.",
"voice": "eve",
"language_code": "auto",
"output_format": {
"codec": "mp3",
"sample_rate": 24000,
"bit_rate": 128000
}
}
}
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({
model: 'xai/tts/v1',
input: {
text: 'Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.',
voice: 'eve',
language_code: 'auto',
output_format: {codec: 'mp3', sample_rate: 24000, bit_rate: 128000}
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', 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.vidgo.ai/api/generate/submit",
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([
'model' => 'xai/tts/v1',
'input' => [
'text' => 'Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.',
'voice' => 'eve',
'language_code' => 'auto',
'output_format' => [
'codec' => 'mp3',
'sample_rate' => 24000,
'bit_rate' => 128000
]
]
]),
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.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"xai/tts/v1\",\n \"input\": {\n \"text\": \"Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.\",\n \"voice\": \"eve\",\n \"language_code\": \"auto\",\n \"output_format\": {\n \"codec\": \"mp3\",\n \"sample_rate\": 24000,\n \"bit_rate\": 128000\n }\n }\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.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"xai/tts/v1\",\n \"input\": {\n \"text\": \"Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.\",\n \"voice\": \"eve\",\n \"language_code\": \"auto\",\n \"output_format\": {\n \"codec\": \"mp3\",\n \"sample_rate\": 24000,\n \"bit_rate\": 128000\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
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 \"model\": \"xai/tts/v1\",\n \"input\": {\n \"text\": \"Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.\",\n \"voice\": \"eve\",\n \"language_code\": \"auto\",\n \"output_format\": {\n \"codec\": \"mp3\",\n \"sample_rate\": 24000,\n \"bit_rate\": 128000\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}"Request timeout"{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}- Submit the request with
VIDGO_API_KEY. Atask_idis returned immediately. Keep it until the task reachesfinishedorfailed. - Use Query Task Status to retrieve the result. If you provide a
callback_url, Vidgo sends the result to your webhook when the task finishes or fails.
xAI TTS 1
Convert text into speech with xAI TTS, choosing from five voices and multiple languages for narration, dialogue, and spoken content.Available Models
- xai/tts/v1 - Convert text into speech.
Output Options
Output Format
-
output_format: Optional. Supply an object with the fields below. -
output_format.codec: Optional. Accepted values:mp3,wav,pcm,mulaw,alaw. Default:mp3. -
output_format.sample_rate: Optional. Sample rate in Hz. Accepted values:8000,16000,22050,24000,44100,48000. Default:24000. -
output_format.bit_rate: Optional. MP3 bitrate in bits per second. Accepted values:32000,64000,96000,128000,192000,null. MP3 default:128000. -
For
mp3, useoutput_format.bit_rateto select the bitrate. Forwav,pcm,mulaw, andalaw, omitbit_rateor set it tonull.
Key Features
- Convert text into speech.
- Select a voice with
voiceand specify the spoken language withlanguage_code. - Direct pauses, laughter, sighs, whispers, and slower phrases through tags in
text.
Advanced Parameters
Setmodel and optional callback_url at the request root. Place all workflow parameters, including output options, inside input.
Text
text: Required. Supply the text to speak. Length: 1-15,000 characters.- Enter spoken text after trimming leading and trailing whitespace. Tags, punctuation, and spaces within the text count toward the length.
- Add
[laugh],[pause], or[sigh]where the sound belongs. Use<whisper>text</whisper>for whispered passages and<slow>text</slow>for slower delivery.
Voice
voice: Optional. Select the voice. Accepted values:eve,ara,rex,sal,leo. Default:eve.
Language Code
language_code: Optional. String. Default:auto.
Supported language code values
Supported language code values
autoenar-EGar-SAar-AEbnzhfrdehiiditjakopt-BRpt-PTrues-MXes-EStrvi
Output Files
- Read every item in the returned
filesarray. - Generated audio uses
file_type: "audio". - Use
file_urlto download the generated speech.
Request Example
{
"model": "xai/tts/v1",
"input": {
"text": "Welcome to our story. [pause] <whisper>Listen closely.</whisper> [laugh] Let us begin.",
"voice": "eve",
"language_code": "auto",
"output_format": {
"codec": "mp3",
"sample_rate": 24000,
"bit_rate": 128000
}
}
}
Authorizations
Use VIDGO_API_KEY.
Body
application/json
Place model and callback_url at the root. Put text, voice, language_code, and output_format inside input.