Chatterbox API Documentation
Chatterbox Text to Speech generate request - Request Code
POST https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"text": "Hello world, this is a test of the Chatterbox text to speech model.",
"audio_url": "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3",
"exaggeration": 0.25,
"temperature": 0.7,
"cfg": 0.5
} import requests
url = "https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"text": "Hello world, this is a test of the Chatterbox text to speech model.",
"audio_url": "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3",
"exaggeration": 0.25,
"temperature": 0.7,
"cfg": 0.5
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request';
const data = {
text: 'Hello world, this is a test of the Chatterbox text to speech model.',
audio_url: 'https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3',
exaggeration: 0.25,
temperature: 0.7,
cfg: 0.5
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"text": "Hello world, this is a test of the Chatterbox text to speech model.",
"audio_url": "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3",
"exaggeration": 0.25,
"temperature": 0.7,
"cfg": 0.5
}'
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request";
String json = "{" + "\n" +
" \"text\": \"Hello world, this is a test of the Chatterbox text to speech model.\"," + "\n" +
" \"audio_url\": \"https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3\"," + "\n" +
" \"exaggeration\": 0.25," + "\n" +
" \"temperature\": 0.7," + "\n" +
" \"cfg\": 0.5" + "\n" +
"}";
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Cache-Control", "no-cache")
.header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} <?php
$url = 'https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request';
$data = [
'text' => 'Hello world, this is a test of the Chatterbox text to speech model.',
'audio_url' => 'https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3',
'exaggeration' => 0.25,
'temperature' => 0.7,
'cfg' => 0.5
];
$json = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Cache-Control: no-cache',
'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?> Output
Successful API response:
{
"status": "IN_QUEUE",
"request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
"response_url": "https://queue.fal.run/fal-ai/chatterbox/requests/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
} Request Body - Chatterbox Text to Speech generate request
Parameters for /chatterbox-text-to-speech-request:
| Parameter | Required | Type | Description |
|---|---|---|---|
| text | Yes | string | The textual content to convert into speech. Must be a valid string of readable language. |
| audio_url | Optional | string | A URL pointing to an audio file (e.g., MP3) to serve as a voice reference. Used to clone or adapt the speaking style. |
| exaggeration | Optional | number | Controls the degree of expressive emphasis in the generated speech. Higher values increase modulation (e.g., intonation, stress). Range: 0.0 to 1.0. |
| temperature | Optional | number | Controls randomness in voice generation. Higher values increase variability in pitch and timing; lower values produce more consistent, predictable speech. Range: 0.1 to 1.0. |
| cfg | Optional | number | Classifier-Free Guidance strength. Influences how closely the output adheres to the input prompt and reference audio. Higher values increase fidelity. Range: 0.0 to 2.0. |
Example Request - Chatterbox Text to Speech generate request
JSON
{
"text": "Hello world, this is a test of the Chatterbox text to speech model.",
"audio_url": "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3",
"exaggeration": 0.25,
"temperature": 0.7,
"cfg": 0.5
} Response - Chatterbox Text to Speech generate request
JSON
{
"status": "IN_QUEUE",
"request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
"response_url": "https://queue.fal.run/fal-ai/chatterbox/requests/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
} Request Headers
| Header | Description |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| Ocp-Apim-Subscription-Key | Your subscription key for authentication |
Response Handling
The Chatterbox Text to Speech returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.
Common Status Codes and Responses
| Status Code | Description | Response Body |
|---|---|---|
| 200 | Success - The request was successfully processed. | { "success": true, ... } |
| 400 | Bad Request - The request contains invalid parameters or missing fields. | { "error": "Invalid request parameters" } |
| 401 | Unauthorized - The provided subscription key is missing or invalid. | { "error": "Invalid or missing authentication" } |
| 403 | Forbidden - The subscription does not have access to this API or action. | { "error": "Access denied for this operation" } |
| 404 | Not Found - The requested resource or endpoint could not be found. | { "error": "Endpoint not found" } |
| 429 | Too Many Requests - The request rate limit has been exceeded. | { "error": "Rate limit exceeded, please retry later" } |
| 500 | Internal Server Error - An unexpected error occurred on the server. | { "error": "An unexpected error occurred, please try again later" } |
Example Error Response
{
"error": "Invalid parameters"
} Retrieving Results
After submitting your request, use this endpoint to check status and retrieve results.
Endpoint
POST https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result
Request Body
{
"request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
} POST https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY
{
"request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
} import requests
url = "https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result"
headers = {
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
"request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result';
const data = {
request_id: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8'
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cache-Control': 'no-cache',
'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
"request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"
}'
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result";
String json = "{" + "\n" +
" \"request_id\": \"a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8\"" + "\n" +
"}";
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Cache-Control", "no-cache")
.header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} <?php
$url = 'https://gateway.pixazo.ai/chatterbox-text-to-speech/v1/chatterbox-text-to-speech-request-result';
$data = [
'request_id' => 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8'
];
$json = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Cache-Control: no-cache',
'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?> Chatterbox API Pricing
| Resolution | Price (USD) |
|---|---|
| All Resolution | $0.03 |
Ready to generate Chatterbox API assets?
Start with an API key, then automate your pipeline.
