Batch-synthesize speech via Orpheus-3B
curl --request POST \
--url https://api.sunbird.ai/tasks/modal/orpheus/tts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"text": "<string>",
"speaker_id": "salt_lug_0001",
"language": "<string>",
"seed": 123,
"temperature": 0.6,
"top_p": 0.95,
"repetition_penalty": 1.1,
"max_tokens": 1200
}
]
}
'import requests
url = "https://api.sunbird.ai/tasks/modal/orpheus/tts/batch"
payload = { "items": [
{
"text": "<string>",
"speaker_id": "salt_lug_0001",
"language": "<string>",
"seed": 123,
"temperature": 0.6,
"top_p": 0.95,
"repetition_penalty": 1.1,
"max_tokens": 1200
}
] }
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: [
{
text: '<string>',
speaker_id: 'salt_lug_0001',
language: '<string>',
seed: 123,
temperature: 0.6,
top_p: 0.95,
repetition_penalty: 1.1,
max_tokens: 1200
}
]
})
};
fetch('https://api.sunbird.ai/tasks/modal/orpheus/tts/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/modal/orpheus/tts/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' => [
[
'text' => '<string>',
'speaker_id' => 'salt_lug_0001',
'language' => '<string>',
'seed' => 123,
'temperature' => 0.6,
'top_p' => 0.95,
'repetition_penalty' => 1.1,
'max_tokens' => 1200
]
]
]),
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/modal/orpheus/tts/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"text\": \"<string>\",\n \"speaker_id\": \"salt_lug_0001\",\n \"language\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 0.6,\n \"top_p\": 0.95,\n \"repetition_penalty\": 1.1,\n \"max_tokens\": 1200\n }\n ]\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/modal/orpheus/tts/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"text\": \"<string>\",\n \"speaker_id\": \"salt_lug_0001\",\n \"language\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 0.6,\n \"top_p\": 0.95,\n \"repetition_penalty\": 1.1,\n \"max_tokens\": 1200\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunbird.ai/tasks/modal/orpheus/tts/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 \"text\": \"<string>\",\n \"speaker_id\": \"salt_lug_0001\",\n \"language\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 0.6,\n \"top_p\": 0.95,\n \"repetition_penalty\": 1.1,\n \"max_tokens\": 1200\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"index": 123,
"speaker_id": "<string>",
"audio_url": "<string>",
"audio_url_expires_at": "2023-11-07T05:31:56Z",
"language": "<string>",
"sample_rate": 24000,
"duration_seconds": 123,
"audio_size_bytes": 123,
"gcs_object": "<string>",
"request_id": "<string>",
"error_code": "<string>",
"error_detail": "<string>"
}
],
"timings_ms": {
"inference_ms": 123,
"upload_ms": 123,
"total_ms": 123
},
"request_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Legacy Text to Speech
Batch Synthesize Speech (Orpheus-3B)
deprecated
Calls Modal’s batched inference endpoint (a single vLLM continuous-batched pass) and uploads each generated WAV to GCS in parallel. Per-item failures are reported in the response with status: "error"; the request as a whole returns 200 if at least one item succeeds, 502 if every item failed. DEPRECATED: use POST /tasks/audio/speech/batch.
POST
/
tasks
/
modal
/
orpheus
/
tts
/
batch
Batch-synthesize speech via Orpheus-3B
curl --request POST \
--url https://api.sunbird.ai/tasks/modal/orpheus/tts/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"text": "<string>",
"speaker_id": "salt_lug_0001",
"language": "<string>",
"seed": 123,
"temperature": 0.6,
"top_p": 0.95,
"repetition_penalty": 1.1,
"max_tokens": 1200
}
]
}
'import requests
url = "https://api.sunbird.ai/tasks/modal/orpheus/tts/batch"
payload = { "items": [
{
"text": "<string>",
"speaker_id": "salt_lug_0001",
"language": "<string>",
"seed": 123,
"temperature": 0.6,
"top_p": 0.95,
"repetition_penalty": 1.1,
"max_tokens": 1200
}
] }
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: [
{
text: '<string>',
speaker_id: 'salt_lug_0001',
language: '<string>',
seed: 123,
temperature: 0.6,
top_p: 0.95,
repetition_penalty: 1.1,
max_tokens: 1200
}
]
})
};
fetch('https://api.sunbird.ai/tasks/modal/orpheus/tts/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/modal/orpheus/tts/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' => [
[
'text' => '<string>',
'speaker_id' => 'salt_lug_0001',
'language' => '<string>',
'seed' => 123,
'temperature' => 0.6,
'top_p' => 0.95,
'repetition_penalty' => 1.1,
'max_tokens' => 1200
]
]
]),
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/modal/orpheus/tts/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"text\": \"<string>\",\n \"speaker_id\": \"salt_lug_0001\",\n \"language\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 0.6,\n \"top_p\": 0.95,\n \"repetition_penalty\": 1.1,\n \"max_tokens\": 1200\n }\n ]\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/modal/orpheus/tts/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"text\": \"<string>\",\n \"speaker_id\": \"salt_lug_0001\",\n \"language\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 0.6,\n \"top_p\": 0.95,\n \"repetition_penalty\": 1.1,\n \"max_tokens\": 1200\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunbird.ai/tasks/modal/orpheus/tts/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 \"text\": \"<string>\",\n \"speaker_id\": \"salt_lug_0001\",\n \"language\": \"<string>\",\n \"seed\": 123,\n \"temperature\": 0.6,\n \"top_p\": 0.95,\n \"repetition_penalty\": 1.1,\n \"max_tokens\": 1200\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"index": 123,
"speaker_id": "<string>",
"audio_url": "<string>",
"audio_url_expires_at": "2023-11-07T05:31:56Z",
"language": "<string>",
"sample_rate": 24000,
"duration_seconds": 123,
"audio_size_bytes": 123,
"gcs_object": "<string>",
"request_id": "<string>",
"error_code": "<string>",
"error_detail": "<string>"
}
],
"timings_ms": {
"inference_ms": 123,
"upload_ms": 123,
"total_ms": 123
},
"request_id": "<string>"
}{
"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
Required array length:
1 - 128 elementsShow child attributes
Show child attributes
⌘I

