Batch-generate speech (orpheus-3b-tts only)
curl --request POST \
--url https://api.sunbird.ai/tasks/audio/speech/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"language": "eng",
"max_tokens": 1200,
"repetition_penalty": 1.1,
"seed": 42,
"temperature": 0.6,
"text": "I am a nurse who takes care of many people.",
"top_p": 0.95,
"voice": "salt_eng_0001"
}
],
"model": "orpheus-3b-tts"
}
'import requests
url = "https://api.sunbird.ai/tasks/audio/speech/batch"
payload = {
"items": [
{
"language": "eng",
"max_tokens": 1200,
"repetition_penalty": 1.1,
"seed": 42,
"temperature": 0.6,
"text": "I am a nurse who takes care of many people.",
"top_p": 0.95,
"voice": "salt_eng_0001"
}
],
"model": "orpheus-3b-tts"
}
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({
items: [
{
language: 'eng',
max_tokens: 1200,
repetition_penalty: 1.1,
seed: 42,
temperature: 0.6,
text: 'I am a nurse who takes care of many people.',
top_p: 0.95,
voice: 'salt_eng_0001'
}
],
model: 'orpheus-3b-tts'
})
};
fetch('https://api.sunbird.ai/tasks/audio/speech/batch', 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.sunbird.ai/tasks/audio/speech/batch",
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([
'items' => [
[
'language' => 'eng',
'max_tokens' => 1200,
'repetition_penalty' => 1.1,
'seed' => 42,
'temperature' => 0.6,
'text' => 'I am a nurse who takes care of many people.',
'top_p' => 0.95,
'voice' => 'salt_eng_0001'
]
],
'model' => 'orpheus-3b-tts'
]),
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://api.sunbird.ai/tasks/audio/speech/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"language\": \"eng\",\n \"max_tokens\": 1200,\n \"repetition_penalty\": 1.1,\n \"seed\": 42,\n \"temperature\": 0.6,\n \"text\": \"I am a nurse who takes care of many people.\",\n \"top_p\": 0.95,\n \"voice\": \"salt_eng_0001\"\n }\n ],\n \"model\": \"orpheus-3b-tts\"\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://api.sunbird.ai/tasks/audio/speech/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"language\": \"eng\",\n \"max_tokens\": 1200,\n \"repetition_penalty\": 1.1,\n \"seed\": 42,\n \"temperature\": 0.6,\n \"text\": \"I am a nurse who takes care of many people.\",\n \"top_p\": 0.95,\n \"voice\": \"salt_eng_0001\"\n }\n ],\n \"model\": \"orpheus-3b-tts\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunbird.ai/tasks/audio/speech/batch")
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 \"items\": [\n {\n \"language\": \"eng\",\n \"max_tokens\": 1200,\n \"repetition_penalty\": 1.1,\n \"seed\": 42,\n \"temperature\": 0.6,\n \"text\": \"I am a nurse who takes care of many people.\",\n \"top_p\": 0.95,\n \"voice\": \"salt_eng_0001\"\n }\n ],\n \"model\": \"orpheus-3b-tts\"\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"platform": "<string>",
"results": [
{
"index": 123,
"voice": "<string>",
"audio_url": "<string>",
"audio_url_expires_at": "2023-11-07T05:31:56Z",
"language": "<string>",
"sample_rate": 123,
"duration_seconds": 123,
"audio_size_bytes": 123,
"gcs_object": "<string>",
"request_id": "<string>",
"error_code": "<string>",
"error_detail": "<string>"
}
],
"request_id": "<string>",
"timings_ms": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Text to Speech
Batch Text to Speech
Batch Text-to-Speech endpoint. Synthesizes 1-128 items in a single orpheus-3b-tts pass and uploads each result to GCS. Per-item failures are reported with status=‘error’; the request returns 200 if at least one item succeeds, 502 if every item fails. Replaces /tasks/modal/orpheus/tts/batch.
POST
/
tasks
/
audio
/
speech
/
batch
Batch-generate speech (orpheus-3b-tts only)
curl --request POST \
--url https://api.sunbird.ai/tasks/audio/speech/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"language": "eng",
"max_tokens": 1200,
"repetition_penalty": 1.1,
"seed": 42,
"temperature": 0.6,
"text": "I am a nurse who takes care of many people.",
"top_p": 0.95,
"voice": "salt_eng_0001"
}
],
"model": "orpheus-3b-tts"
}
'import requests
url = "https://api.sunbird.ai/tasks/audio/speech/batch"
payload = {
"items": [
{
"language": "eng",
"max_tokens": 1200,
"repetition_penalty": 1.1,
"seed": 42,
"temperature": 0.6,
"text": "I am a nurse who takes care of many people.",
"top_p": 0.95,
"voice": "salt_eng_0001"
}
],
"model": "orpheus-3b-tts"
}
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({
items: [
{
language: 'eng',
max_tokens: 1200,
repetition_penalty: 1.1,
seed: 42,
temperature: 0.6,
text: 'I am a nurse who takes care of many people.',
top_p: 0.95,
voice: 'salt_eng_0001'
}
],
model: 'orpheus-3b-tts'
})
};
fetch('https://api.sunbird.ai/tasks/audio/speech/batch', 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.sunbird.ai/tasks/audio/speech/batch",
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([
'items' => [
[
'language' => 'eng',
'max_tokens' => 1200,
'repetition_penalty' => 1.1,
'seed' => 42,
'temperature' => 0.6,
'text' => 'I am a nurse who takes care of many people.',
'top_p' => 0.95,
'voice' => 'salt_eng_0001'
]
],
'model' => 'orpheus-3b-tts'
]),
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://api.sunbird.ai/tasks/audio/speech/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"language\": \"eng\",\n \"max_tokens\": 1200,\n \"repetition_penalty\": 1.1,\n \"seed\": 42,\n \"temperature\": 0.6,\n \"text\": \"I am a nurse who takes care of many people.\",\n \"top_p\": 0.95,\n \"voice\": \"salt_eng_0001\"\n }\n ],\n \"model\": \"orpheus-3b-tts\"\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://api.sunbird.ai/tasks/audio/speech/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"language\": \"eng\",\n \"max_tokens\": 1200,\n \"repetition_penalty\": 1.1,\n \"seed\": 42,\n \"temperature\": 0.6,\n \"text\": \"I am a nurse who takes care of many people.\",\n \"top_p\": 0.95,\n \"voice\": \"salt_eng_0001\"\n }\n ],\n \"model\": \"orpheus-3b-tts\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunbird.ai/tasks/audio/speech/batch")
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 \"items\": [\n {\n \"language\": \"eng\",\n \"max_tokens\": 1200,\n \"repetition_penalty\": 1.1,\n \"seed\": 42,\n \"temperature\": 0.6,\n \"text\": \"I am a nurse who takes care of many people.\",\n \"top_p\": 0.95,\n \"voice\": \"salt_eng_0001\"\n }\n ],\n \"model\": \"orpheus-3b-tts\"\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"platform": "<string>",
"results": [
{
"index": 123,
"voice": "<string>",
"audio_url": "<string>",
"audio_url_expires_at": "2023-11-07T05:31:56Z",
"language": "<string>",
"sample_rate": 123,
"duration_seconds": 123,
"audio_size_bytes": 123,
"gcs_object": "<string>",
"request_id": "<string>",
"error_code": "<string>",
"error_detail": "<string>"
}
],
"request_id": "<string>",
"timings_ms": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Response
Successful Response
Normalized batch response.
Model used (always 'orpheus-3b-tts').
Platform used (always 'modal').
Per-item results, in request order.
Show child attributes
Show child attributes
Unique id for this batch request.
⌘I

