Text to Speech
curl --request POST \
--url https://api.novita.ai/v3/async/txt2speech \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"extra": {
"response_audio_type": "<string>",
"webhook": {
"url": "<string>",
"test_mode": {
"enabled": true,
"return_task_status": "<string>"
}
},
"enterprise_plan": {
"enabled": true
}
},
"request": {
"voice_id": "<string>",
"language": "<string>",
"texts": [
"<string>"
],
"volume": 123,
"speed": 123
}
}
'import requests
url = "https://api.novita.ai/v3/async/txt2speech"
payload = {
"extra": {
"response_audio_type": "<string>",
"webhook": {
"url": "<string>",
"test_mode": {
"enabled": True,
"return_task_status": "<string>"
}
},
"enterprise_plan": { "enabled": True }
},
"request": {
"voice_id": "<string>",
"language": "<string>",
"texts": ["<string>"],
"volume": 123,
"speed": 123
}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
extra: {
response_audio_type: '<string>',
webhook: {url: '<string>', test_mode: {enabled: true, return_task_status: '<string>'}},
enterprise_plan: {enabled: true}
},
request: {
voice_id: '<string>',
language: '<string>',
texts: ['<string>'],
volume: 123,
speed: 123
}
})
};
fetch('https://api.novita.ai/v3/async/txt2speech', 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.novita.ai/v3/async/txt2speech",
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([
'extra' => [
'response_audio_type' => '<string>',
'webhook' => [
'url' => '<string>',
'test_mode' => [
'enabled' => true,
'return_task_status' => '<string>'
]
],
'enterprise_plan' => [
'enabled' => true
]
],
'request' => [
'voice_id' => '<string>',
'language' => '<string>',
'texts' => [
'<string>'
],
'volume' => 123,
'speed' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.novita.ai/v3/async/txt2speech"
payload := strings.NewReader("{\n \"extra\": {\n \"response_audio_type\": \"<string>\",\n \"webhook\": {\n \"url\": \"<string>\",\n \"test_mode\": {\n \"enabled\": true,\n \"return_task_status\": \"<string>\"\n }\n },\n \"enterprise_plan\": {\n \"enabled\": true\n }\n },\n \"request\": {\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"texts\": [\n \"<string>\"\n ],\n \"volume\": 123,\n \"speed\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v3/async/txt2speech")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"extra\": {\n \"response_audio_type\": \"<string>\",\n \"webhook\": {\n \"url\": \"<string>\",\n \"test_mode\": {\n \"enabled\": true,\n \"return_task_status\": \"<string>\"\n }\n },\n \"enterprise_plan\": {\n \"enabled\": true\n }\n },\n \"request\": {\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"texts\": [\n \"<string>\"\n ],\n \"volume\": 123,\n \"speed\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v3/async/txt2speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"extra\": {\n \"response_audio_type\": \"<string>\",\n \"webhook\": {\n \"url\": \"<string>\",\n \"test_mode\": {\n \"enabled\": true,\n \"return_task_status\": \"<string>\"\n }\n },\n \"enterprise_plan\": {\n \"enabled\": true\n }\n },\n \"request\": {\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"texts\": [\n \"<string>\"\n ],\n \"volume\": 123,\n \"speed\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Audio
Text to Speech
POST
/
v3
/
async
/
txt2speech
Text to Speech
curl --request POST \
--url https://api.novita.ai/v3/async/txt2speech \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"extra": {
"response_audio_type": "<string>",
"webhook": {
"url": "<string>",
"test_mode": {
"enabled": true,
"return_task_status": "<string>"
}
},
"enterprise_plan": {
"enabled": true
}
},
"request": {
"voice_id": "<string>",
"language": "<string>",
"texts": [
"<string>"
],
"volume": 123,
"speed": 123
}
}
'import requests
url = "https://api.novita.ai/v3/async/txt2speech"
payload = {
"extra": {
"response_audio_type": "<string>",
"webhook": {
"url": "<string>",
"test_mode": {
"enabled": True,
"return_task_status": "<string>"
}
},
"enterprise_plan": { "enabled": True }
},
"request": {
"voice_id": "<string>",
"language": "<string>",
"texts": ["<string>"],
"volume": 123,
"speed": 123
}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
extra: {
response_audio_type: '<string>',
webhook: {url: '<string>', test_mode: {enabled: true, return_task_status: '<string>'}},
enterprise_plan: {enabled: true}
},
request: {
voice_id: '<string>',
language: '<string>',
texts: ['<string>'],
volume: 123,
speed: 123
}
})
};
fetch('https://api.novita.ai/v3/async/txt2speech', 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.novita.ai/v3/async/txt2speech",
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([
'extra' => [
'response_audio_type' => '<string>',
'webhook' => [
'url' => '<string>',
'test_mode' => [
'enabled' => true,
'return_task_status' => '<string>'
]
],
'enterprise_plan' => [
'enabled' => true
]
],
'request' => [
'voice_id' => '<string>',
'language' => '<string>',
'texts' => [
'<string>'
],
'volume' => 123,
'speed' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.novita.ai/v3/async/txt2speech"
payload := strings.NewReader("{\n \"extra\": {\n \"response_audio_type\": \"<string>\",\n \"webhook\": {\n \"url\": \"<string>\",\n \"test_mode\": {\n \"enabled\": true,\n \"return_task_status\": \"<string>\"\n }\n },\n \"enterprise_plan\": {\n \"enabled\": true\n }\n },\n \"request\": {\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"texts\": [\n \"<string>\"\n ],\n \"volume\": 123,\n \"speed\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v3/async/txt2speech")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"extra\": {\n \"response_audio_type\": \"<string>\",\n \"webhook\": {\n \"url\": \"<string>\",\n \"test_mode\": {\n \"enabled\": true,\n \"return_task_status\": \"<string>\"\n }\n },\n \"enterprise_plan\": {\n \"enabled\": true\n }\n },\n \"request\": {\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"texts\": [\n \"<string>\"\n ],\n \"volume\": 123,\n \"speed\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v3/async/txt2speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"extra\": {\n \"response_audio_type\": \"<string>\",\n \"webhook\": {\n \"url\": \"<string>\",\n \"test_mode\": {\n \"enabled\": true,\n \"return_task_status\": \"<string>\"\n }\n },\n \"enterprise_plan\": {\n \"enabled\": true\n }\n },\n \"request\": {\n \"voice_id\": \"<string>\",\n \"language\": \"<string>\",\n \"texts\": [\n \"<string>\"\n ],\n \"volume\": 123,\n \"speed\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}This Text-To-Speech API converts written text into natural-sounding speech across multiple languages. Utilizing advanced voice synthesis technology, it delivers clear and lifelike vocal output, suitable for a wide range of applications, including e-learning platforms, accessibility tools, virtual assistants, and multimedia presentations.
response
This is an asynchronous API; only the task_id will be returned. You should use the task_id to request the Task Result API to retrieve the speech generation results.
Request Headers
Enum:
application/jsonBearer authentication format, for example: Bearer {{API Key}}.
Request Body
Optional extra parameters for the request.
Show properties
Show properties
The returned audio type. Default is wav.
Enum:
Enum:
wav, mp3Webhook settings. More details can be found at Webhook Documentation.
Show properties
Show properties
The URL of the webhook endpoint. Novita AI will send the task generated outputs to your specified webhook endpoint.
By specifying Test Mode, a mock event will be sent to the webhook endpoint.
Show properties
Show properties
Set to true to enable Test Mode, or false to disable it. The default is false.
Control the data content of the mock event. When set to TASK_STATUS_SUCCEED, you’ll receive a normal response; when set to TASK_STATUS_FAILED, you’ll receive an error response.
Enum:
Enum:
TASK_STATUS_SUCCEED, TASK_STATUS_FAILEDDedicated Endpoints settings, which only take effect for users who have already subscribed to the Dedicated Endpoints Documentation.
Show properties
Show properties
Set to true to schedule this task to use your Dedicated Endpoints’s dedicated resources. Default is false.
Hide properties
Hide properties
Voice ID
Enum:
Enum:
Emily, James, Olivia, Michael, Sarah, JohnIdentify the languages spoken in the generated audio
Enum:
Enum:
en-US, zh-CN, ja-JPSource text for synthetic speech, UTF-8 encoded, supporting a maximum of 512 characters.
Control the volume of the generated audio; select a value between 1.0 and 2.0. The default value is 1.0.
Control the speed of the generated audio; select a value between 0.8 and 3.0. The default value is 1.0.
Response
Use the task_id to request the Task Result API to retrieve the generated outputs.
Example
requestcurl --location 'https://api.novita.ai/v3/async/txt2speech' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"request": {
"voice_id": "Emily",
"language": "en-US",
"texts": [
"To be or not to be, that is a question."
],
"volume": 1.2,
"speed": 1.0
}
}'
{
"task_id": "b49df8dc-4a72-474b-a863-xxx"
}
Last modified on January 14, 2026
Was this page helpful?
⌘I