curl --request POST \
--url https://api.weryai.com/v1/generation/text-to-audio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, welcome to WeryAI!",
"voice_id": 85,
"speed": "1.0",
"vol": "4.0",
"webhook_url": "https://your-server.com/webhook"
}
'import requests
url = "https://api.weryai.com/v1/generation/text-to-audio"
payload = {
"text": "Hello, welcome to WeryAI!",
"voice_id": 85,
"speed": "1.0",
"vol": "4.0",
"webhook_url": "https://your-server.com/webhook"
}
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({
text: 'Hello, welcome to WeryAI!',
voice_id: 85,
speed: '1.0',
vol: '4.0',
webhook_url: 'https://your-server.com/webhook'
})
};
fetch('https://api.weryai.com/v1/generation/text-to-audio', 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.weryai.com/v1/generation/text-to-audio",
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, welcome to WeryAI!',
'voice_id' => 85,
'speed' => '1.0',
'vol' => '4.0',
'webhook_url' => 'https://your-server.com/webhook'
]),
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.weryai.com/v1/generation/text-to-audio"
payload := strings.NewReader("{\n \"text\": \"Hello, welcome to WeryAI!\",\n \"voice_id\": 85,\n \"speed\": \"1.0\",\n \"vol\": \"4.0\",\n \"webhook_url\": \"https://your-server.com/webhook\"\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.weryai.com/v1/generation/text-to-audio")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, welcome to WeryAI!\",\n \"voice_id\": 85,\n \"speed\": \"1.0\",\n \"vol\": \"4.0\",\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/text-to-audio")
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 \"text\": \"Hello, welcome to WeryAI!\",\n \"voice_id\": 85,\n \"speed\": \"1.0\",\n \"vol\": \"4.0\",\n \"webhook_url\": \"https://your-server.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"desc": "success",
"message": "success",
"data": {
"task_id": "task_abc123",
"task_status": "waiting"
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Submit Text-to-Speech Task
Convert input text into speech audio. Supports custom voice, speed, and volume settings. Results are returned asynchronously via task polling or webhook callback.
curl --request POST \
--url https://api.weryai.com/v1/generation/text-to-audio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, welcome to WeryAI!",
"voice_id": 85,
"speed": "1.0",
"vol": "4.0",
"webhook_url": "https://your-server.com/webhook"
}
'import requests
url = "https://api.weryai.com/v1/generation/text-to-audio"
payload = {
"text": "Hello, welcome to WeryAI!",
"voice_id": 85,
"speed": "1.0",
"vol": "4.0",
"webhook_url": "https://your-server.com/webhook"
}
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({
text: 'Hello, welcome to WeryAI!',
voice_id: 85,
speed: '1.0',
vol: '4.0',
webhook_url: 'https://your-server.com/webhook'
})
};
fetch('https://api.weryai.com/v1/generation/text-to-audio', 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.weryai.com/v1/generation/text-to-audio",
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, welcome to WeryAI!',
'voice_id' => 85,
'speed' => '1.0',
'vol' => '4.0',
'webhook_url' => 'https://your-server.com/webhook'
]),
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.weryai.com/v1/generation/text-to-audio"
payload := strings.NewReader("{\n \"text\": \"Hello, welcome to WeryAI!\",\n \"voice_id\": 85,\n \"speed\": \"1.0\",\n \"vol\": \"4.0\",\n \"webhook_url\": \"https://your-server.com/webhook\"\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.weryai.com/v1/generation/text-to-audio")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, welcome to WeryAI!\",\n \"voice_id\": 85,\n \"speed\": \"1.0\",\n \"vol\": \"4.0\",\n \"webhook_url\": \"https://your-server.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weryai.com/v1/generation/text-to-audio")
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 \"text\": \"Hello, welcome to WeryAI!\",\n \"voice_id\": 85,\n \"speed\": \"1.0\",\n \"vol\": \"4.0\",\n \"webhook_url\": \"https://your-server.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"desc": "success",
"message": "success",
"data": {
"task_id": "task_abc123",
"task_status": "waiting"
}
}{
"status": 1001,
"desc": "Parameter error",
"message": "Prompt cannot be empty"
}{
"status": 1002,
"desc": "Authentication failed",
"message": "Invalid API Key"
}Authorizations
Authenticate using Bearer token. Get your API Key from the WeryAI Console.
Example: Authorization: Bearer sk-xxxxxxxxxxxxxxxx
Body
Input text to synthesize, maximum 500 characters
500"Hello, welcome to WeryAI!"
Voice ID specifying the voice style to use. See the Voice Reference appendix below for all available system voices.
Voice Reference Appendix
English Voices
| ID | Voice Name | Gender | Preview |
|---|---|---|---|
| 85 | Captivating Female | FEMALE | ▶ Preview |
| 84 | Playful Girl | FEMALE | ▶ Preview |
| 83 | Lovely Girl | FEMALE | ▶ Preview |
| 82 | Cheerful Chloe | FEMALE | ▶ Preview |
| 81 | Wise Lady | FEMALE | ▶ Preview |
| 75 | Southern Dude | MALE | ▶ Preview |
| 74 | Lucky Robot | MALE | ▶ Preview |
| 73 | Angry Pirate | MALE | ▶ Preview |
| 72 | Friendly Giant | MALE | ▶ Preview |
| 71 | Man With Deep Voice | MALE | ▶ Preview |
Chinese Voices
| ID | Voice Name | Gender | Preview |
|---|---|---|---|
| 80 | Arrogant Miss | FEMALE | ▶ Preview |
| 79 | Kind-hearted Antie | FEMALE | ▶ Preview |
| 78 | Gentle Senior | FEMALE | ▶ Preview |
| 77 | Intellectual Girl | FEMALE | ▶ Preview |
| 76 | News Anchor | FEMALE | ▶ Preview |
| 70 | Stubborn Friend | MALE | ▶ Preview |
| 69 | Reliable Executive | MALE | ▶ Preview |
| 68 | Lyrical Voice | MALE | ▶ Preview |
| 67 | Refreshing Young Man | MALE | ▶ Preview |
| 66 | Pure-hearted Boy | MALE | ▶ Preview |
85
Speech speed. Higher values produce faster speech. Range: [0.5, 2.0]. Default: 1.0
"1.0"
Volume level. Higher values produce louder audio. Range: (0, 10.0]. Default: 4.0
"4.0"
Caller ID (for business association)
Custom trace ID passed by the caller for request tracing
"my-trace-001"
Callback URL where results will be sent when task completes
"https://your-server.com/webhook"
