3B Orpheus TTS (0.1) Serverless API
Orpheus TTS is an open-source text-to-speech (TTS) system powered by the Llama 3B language model, designed for high-quality and customizable speech synthesis.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/orpheus-3b-0.1"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "text": "Today has been... exhausting. <sigh> First, I missed the bus. Then it started pouring rain—of course, I forgot my umbrella. <groan> And just when I thought things couldn’t get worse, I spilled coffee all over my white shirt right before the presentation. <cough> But hey, at least I survived... kind of.",
12 "top_p": 0.95,
13 "voice": "dan",
14 "temperature": 0.6,
15 "max_new_tokens": 1200,
16 "repetition_penalty": 1.1
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/orpheus-3b-0.1"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "text": "Today has been... exhausting. <sigh> First, I missed the bus. Then it started pouring rain—of course, I forgot my umbrella. <groan> And just when I thought things couldn’t get worse, I spilled coffee all over my white shirt right before the presentation. <cough> But hey, at least I survived... kind of.",
12 "top_p": 0.95,
13 "voice": "dan",
14 "temperature": 0.6,
15 "max_new_tokens": 1200,
16 "repetition_penalty": 1.1
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22 result = response.json()
23 print(json.dumps(result, indent=2))
24else:
25 print(f"Error: {response.status_code}")
26 print(response.text)API Endpoint
https://api.segmind.com/v1/orpheus-3b-0.1Parameters
textrequiredstringInput text to the model to convert to speech
max_new_tokensoptionalintegerMaximum number of tokens to generate
1200Range: 100 - 2000repetition_penaltyoptionalnumberRepetition penalty
1.1Range: 1 - 2temperatureoptionalnumberTemperature for generation. Controls expressiveness: 0.1–0.5 for stable speech, 0.6–1.0 for natural tone, 1.1–1.5 for expressive or dramatic voices.
0.6Range: 0.1 - 1.5top_poptionalnumberTop P for nucleus sampling. Recommended top-p: 0.2–0.4 for neutral tone, 0.6–0.8 for conversational, 0.8–1.0 for expressive, and 0.3–0.5 for assistants.
0.95Range: 0.1 - 1voiceoptionalstringAn enumeration.
"dan""tara""dan""josh""emma"Response Type
Returns: Audio
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out