curl --request POST \
--url https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello from Fish Audio S2.1 Pro.",
"reference_id": "9a9cf47702da476aa4629e2506d4a857",
"format": "mp3"
}
'import requests
url = "https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro"
payload = {
"text": "Hello from Fish Audio S2.1 Pro.",
"reference_id": "9a9cf47702da476aa4629e2506d4a857",
"format": "mp3"
}
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 from Fish Audio S2.1 Pro.',
reference_id: '9a9cf47702da476aa4629e2506d4a857',
format: 'mp3'
})
};
fetch('https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro', 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://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro",
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 from Fish Audio S2.1 Pro.',
'reference_id' => '9a9cf47702da476aa4629e2506d4a857',
'format' => 'mp3'
]),
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://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro"
payload := strings.NewReader("{\n \"text\": \"Hello from Fish Audio S2.1 Pro.\",\n \"reference_id\": \"9a9cf47702da476aa4629e2506d4a857\",\n \"format\": \"mp3\"\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://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello from Fish Audio S2.1 Pro.\",\n \"reference_id\": \"9a9cf47702da476aa4629e2506d4a857\",\n \"format\": \"mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro")
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 from Fish Audio S2.1 Pro.\",\n \"reference_id\": \"9a9cf47702da476aa4629e2506d4a857\",\n \"format\": \"mp3\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "Validation error",
"details": "Missing required field: text"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}Fish TTS S2.1 Pro
Synthesize speech with SLNG-hosted Fish TTS 2.1 Pro in a single HTTP request. The response is binary audio in the format set by format (MP3 by default).
Send application/json to synthesize with a saved voice via reference_id, or application/msgpack to clone a voice from inline reference audio supplied in references. For incremental, low-latency synthesis, connect to the WebSocket channel at the same path instead.
curl --request POST \
--url https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello from Fish Audio S2.1 Pro.",
"reference_id": "9a9cf47702da476aa4629e2506d4a857",
"format": "mp3"
}
'import requests
url = "https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro"
payload = {
"text": "Hello from Fish Audio S2.1 Pro.",
"reference_id": "9a9cf47702da476aa4629e2506d4a857",
"format": "mp3"
}
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 from Fish Audio S2.1 Pro.',
reference_id: '9a9cf47702da476aa4629e2506d4a857',
format: 'mp3'
})
};
fetch('https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro', 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://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro",
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 from Fish Audio S2.1 Pro.',
'reference_id' => '9a9cf47702da476aa4629e2506d4a857',
'format' => 'mp3'
]),
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://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro"
payload := strings.NewReader("{\n \"text\": \"Hello from Fish Audio S2.1 Pro.\",\n \"reference_id\": \"9a9cf47702da476aa4629e2506d4a857\",\n \"format\": \"mp3\"\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://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello from Fish Audio S2.1 Pro.\",\n \"reference_id\": \"9a9cf47702da476aa4629e2506d4a857\",\n \"format\": \"mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-north.api.slng.ai/v1/tts/slng/fish/tts:s2.1-pro")
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 from Fish Audio S2.1 Pro.\",\n \"reference_id\": \"9a9cf47702da476aa4629e2506d4a857\",\n \"format\": \"mp3\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "Validation error",
"details": "Missing required field: text"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}{
"error": "TTS service error",
"status": 400,
"details": "Upstream provider error: 400 Bad Request - Invalid voice"
}Authorizations
API key issued by SLNG. Pass as Authorization: Bearer <token>.
Body
Request body for SLNG-hosted Fish TTS 2.1 Pro synthesis. Shared by the application/json and application/msgpack content types; only MessagePack can carry inline reference audio in references.
Text to synthesize. S2-family variants support multi-speaker dialogue markers.
1Fish Audio voice-model ID. For multi-speaker synthesis, provide one ID per speaker as an array.
Inline reference audio for voice cloning. MessagePack-only, as the entries carry binary audio.
Show child attributes
Show child attributes
Prosody controls.
Show child attributes
Show child attributes
Sampling temperature.
0 <= x <= 1Nucleus sampling probability mass.
0 <= x <= 1Target chunk length for synthesis.
100 <= x <= 300Whether to normalize input text before synthesis.
Output audio format.
wav, pcm, mp3, opus Output sample rate in Hz. This enum is the union across formats; the gateway rejects a rate the selected format does not accept before contacting the provider. wav and pcm accept 8000, 16000, 24000, 32000, and 44100; mp3 accepts 32000 and 44100; opus accepts 48000 only. Omit or send null for the format default (48000 for opus, 44100 otherwise).
8000, 16000, 24000, 32000, 44100, 48000 MP3 bitrate in kbps (used when format is mp3).
64, 128, 192 Opus bitrate in bps (used when format is opus). -1000 selects the provider default.
-1000, 24000, 32000, 48000, 64000 Latency/quality trade-off.
low, normal, balanced Maximum number of new tokens to generate.
Penalty applied to repeated tokens.
Minimum chunk length for synthesis.
0 <= x <= 100Whether generation is conditioned on previously generated chunks.
Early-stop threshold for generation.
0 <= x <= 1Optional feature flags.
Response
Synthesis successful.
Binary audio data.