Fish Audio Text to Speech
curl --request POST \
--url https://api.novita.ai/v4beta/txt2speech \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"text": "<string>",
"temperature": 123,
"top_p": 123,
"references": {
"text": "<string>"
},
"reference_id": {},
"prosody": {
"speed": 123,
"volume": 123
},
"chunk_length": 123,
"normalize": true,
"format": {},
"sample_rate": {},
"mp3_bitrate": {},
"opus_bitrate": {},
"latency": {}
}
'import requests
url = "https://api.novita.ai/v4beta/txt2speech"
payload = {
"text": "<string>",
"temperature": 123,
"top_p": 123,
"references": { "text": "<string>" },
"reference_id": {},
"prosody": {
"speed": 123,
"volume": 123
},
"chunk_length": 123,
"normalize": True,
"format": {},
"sample_rate": {},
"mp3_bitrate": {},
"opus_bitrate": {},
"latency": {}
}
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({
text: '<string>',
temperature: 123,
top_p: 123,
references: {text: '<string>'},
reference_id: {},
prosody: {speed: 123, volume: 123},
chunk_length: 123,
normalize: true,
format: {},
sample_rate: {},
mp3_bitrate: {},
opus_bitrate: {},
latency: {}
})
};
fetch('https://api.novita.ai/v4beta/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/v4beta/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([
'text' => '<string>',
'temperature' => 123,
'top_p' => 123,
'references' => [
'text' => '<string>'
],
'reference_id' => [
],
'prosody' => [
'speed' => 123,
'volume' => 123
],
'chunk_length' => 123,
'normalize' => true,
'format' => [
],
'sample_rate' => [
],
'mp3_bitrate' => [
],
'opus_bitrate' => [
],
'latency' => [
]
]),
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/v4beta/txt2speech"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"references\": {\n \"text\": \"<string>\"\n },\n \"reference_id\": {},\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123\n },\n \"chunk_length\": 123,\n \"normalize\": true,\n \"format\": {},\n \"sample_rate\": {},\n \"mp3_bitrate\": {},\n \"opus_bitrate\": {},\n \"latency\": {}\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/v4beta/txt2speech")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"text\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"references\": {\n \"text\": \"<string>\"\n },\n \"reference_id\": {},\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123\n },\n \"chunk_length\": 123,\n \"normalize\": true,\n \"format\": {},\n \"sample_rate\": {},\n \"mp3_bitrate\": {},\n \"opus_bitrate\": {},\n \"latency\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v4beta/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 \"text\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"references\": {\n \"text\": \"<string>\"\n },\n \"reference_id\": {},\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123\n },\n \"chunk_length\": 123,\n \"normalize\": true,\n \"format\": {},\n \"sample_rate\": {},\n \"mp3_bitrate\": {},\n \"opus_bitrate\": {},\n \"latency\": {}\n}"
response = http.request(request)
puts response.read_bodyAudio
Fish Audio Text to Speech
POST
/
v4beta
/
txt2speech
Fish Audio Text to Speech
curl --request POST \
--url https://api.novita.ai/v4beta/txt2speech \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"text": "<string>",
"temperature": 123,
"top_p": 123,
"references": {
"text": "<string>"
},
"reference_id": {},
"prosody": {
"speed": 123,
"volume": 123
},
"chunk_length": 123,
"normalize": true,
"format": {},
"sample_rate": {},
"mp3_bitrate": {},
"opus_bitrate": {},
"latency": {}
}
'import requests
url = "https://api.novita.ai/v4beta/txt2speech"
payload = {
"text": "<string>",
"temperature": 123,
"top_p": 123,
"references": { "text": "<string>" },
"reference_id": {},
"prosody": {
"speed": 123,
"volume": 123
},
"chunk_length": 123,
"normalize": True,
"format": {},
"sample_rate": {},
"mp3_bitrate": {},
"opus_bitrate": {},
"latency": {}
}
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({
text: '<string>',
temperature: 123,
top_p: 123,
references: {text: '<string>'},
reference_id: {},
prosody: {speed: 123, volume: 123},
chunk_length: 123,
normalize: true,
format: {},
sample_rate: {},
mp3_bitrate: {},
opus_bitrate: {},
latency: {}
})
};
fetch('https://api.novita.ai/v4beta/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/v4beta/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([
'text' => '<string>',
'temperature' => 123,
'top_p' => 123,
'references' => [
'text' => '<string>'
],
'reference_id' => [
],
'prosody' => [
'speed' => 123,
'volume' => 123
],
'chunk_length' => 123,
'normalize' => true,
'format' => [
],
'sample_rate' => [
],
'mp3_bitrate' => [
],
'opus_bitrate' => [
],
'latency' => [
]
]),
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/v4beta/txt2speech"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"references\": {\n \"text\": \"<string>\"\n },\n \"reference_id\": {},\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123\n },\n \"chunk_length\": 123,\n \"normalize\": true,\n \"format\": {},\n \"sample_rate\": {},\n \"mp3_bitrate\": {},\n \"opus_bitrate\": {},\n \"latency\": {}\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/v4beta/txt2speech")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"text\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"references\": {\n \"text\": \"<string>\"\n },\n \"reference_id\": {},\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123\n },\n \"chunk_length\": 123,\n \"normalize\": true,\n \"format\": {},\n \"sample_rate\": {},\n \"mp3_bitrate\": {},\n \"opus_bitrate\": {},\n \"latency\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v4beta/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 \"text\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"references\": {\n \"text\": \"<string>\"\n },\n \"reference_id\": {},\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123\n },\n \"chunk_length\": 123,\n \"normalize\": true,\n \"format\": {},\n \"sample_rate\": {},\n \"mp3_bitrate\": {},\n \"opus_bitrate\": {},\n \"latency\": {}\n}"
response = http.request(request)
puts response.read_bodyFor best results, upload reference audio using the create model before using this one. This improves speech quality and reduces latency.
-
WAV / PCM
- Sample Rate: 8kHz, 16kHz, 24kHz, 32kHz, 44.1kHz
- Default Sample Rate: 44.1kHz
- 16-bit, mono
-
MP3
- Sample Rate: 32kHz, 44.1kHz
- Default Sample Rate: 44.1kHz
- mono
- Bitrate: 64kbps, 128kbps (default), 192kbps
-
Opus
- Sample Rate: 48kHz
- Default Sample Rate: 48kHz
- mono
- Bitrate: -1000 (auto), 24kbps, 32kbps (default), 48kbps, 64kbps
Request Headers
string
vereist
Enum:
application/jsonstring
vereist
Bearer authentication format, for example: Bearer {{API Key}}.
enum<string>
standaard:"s1"
Specify which TTS model to use. Only supports model:
s1.Request Body
string
vereist
Text to be converted to speech.
number
Controls randomness in the speech generation. Higher values (e.g., 1.0) make the output more random, while lower values (e.g., 0.1) make it more deterministic. We recommend
0.9 for s1 model.Required range: 0 <= x <= 1number
Controls diversity via nucleus sampling. Lower values (e.g., 0.1) make the output more focused, while higher values (e.g., 1.0) allow more diversity. We recommend
0.9 for s1 model.Required range: 0 <= x <= 1ReferenceAudio · object[] | null
string | null
ID of the reference model to be used for the speech.
ProsodyControl · object
integer
standaard:200
Chunk length to be used for the speech.Required range:
100 <= x <= 300boolean
standaard:true
Whether to normalize the speech, this will reduce the latency but may reduce performance on numbers and dates.
enum<string>
standaard:"mp3"
Format to be used for the speech.Available options:
wav, pcm, mp3, opusinteger | null
Sample rate to be used for the speech.
enum<integer>
standaard:128
MP3 Bitrate to be used for the speech.Available options:
64, 128, 192enum<integer>
standaard:32
Opus Bitrate to be used for the speech.Available options:
-1000, 24, 32, 48, 64enum<string>
standaard:"normal"
Latency to be used for the speech, balanced will reduce the latency but may lead to performance degradation.Available options:
normal, balancedResponse
The API will directly return the audio stream in the format specified by theformat parameter (default: mp3).Laatst gewijzigd op 10 augustus 2026