Skip to main content
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.
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

Content-Type
string
required
Enum: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

extra
object
Optional extra parameters for the request.
request
object
required

Response

task_id
string
Use the task_id to request the Task Result API to retrieve the generated outputs.

Example

request
curl --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
  }
}'
response
{
  "task_id": "b49df8dc-4a72-474b-a863-xxx"
}
Last modified on January 14, 2026