Sarvam Bulbul v3 TTS Serverless API
Text-to-speech in 11 Indian languages with 37 voices.
POST /v2/sarvam-bulbul-v3-tts · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "sarvam-bulbul-v3-tts",
9 text="नमस्ते! सेगमाइंड में आपका स्वागत है। आज हम भारतीय भाषाओं के लिए natural text-to-speech का demo देखेंगे।",
10 language_code="hi-IN",
11 speaker="shubh",
12 pace=1,
13 temperature=0.6,
14 output_audio_codec="wav",
15 speech_sample_rate=24000,
16)
17print(result["status"]) # COMPLETED
18print(result.get("output")) # model output (e.g. media URL)
19print(result["metrics"]["inference_time"]) # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient() # reads SEGMIND_API_KEY
25payload = {
26 "text": "नमस्ते! सेगमाइंड में आपका स्वागत है। आज हम भारतीय भाषाओं के लिए natural text-to-speech का demo देखेंगे।",
27 "language_code": "hi-IN",
28 "speaker": "shubh",
29 "pace": 1,
30 "temperature": 0.6,
31 "output_audio_codec": "wav",
32 "speech_sample_rate": 24000,
33}
34job = client.submit_async("sarvam-bulbul-v3-tts", **payload)
35print(job.request_id) # available immediately
36try:
37 result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39 print("still running:", e.request_id)
40except InferenceFailed as e:
41 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "sarvam-bulbul-v3-tts",
9 text="नमस्ते! सेगमाइंड में आपका स्वागत है। आज हम भारतीय भाषाओं के लिए natural text-to-speech का demo देखेंगे।",
10 language_code="hi-IN",
11 speaker="shubh",
12 pace=1,
13 temperature=0.6,
14 output_audio_codec="wav",
15 speech_sample_rate=24000,
16)
17print(result["status"]) # COMPLETED
18print(result.get("output")) # model output (e.g. media URL)
19print(result["metrics"]["inference_time"]) # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient() # reads SEGMIND_API_KEY
25payload = {
26 "text": "नमस्ते! सेगमाइंड में आपका स्वागत है। आज हम भारतीय भाषाओं के लिए natural text-to-speech का demo देखेंगे।",
27 "language_code": "hi-IN",
28 "speaker": "shubh",
29 "pace": 1,
30 "temperature": 0.6,
31 "output_audio_codec": "wav",
32 "speech_sample_rate": 24000,
33}
34job = client.submit_async("sarvam-bulbul-v3-tts", **payload)
35print(job.request_id) # available immediately
36try:
37 result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39 print("still running:", e.request_id)
40except InferenceFailed as e:
41 print("failed:", e.detail)API Endpoint
https://api.segmind.com/v1/sarvam-bulbul-v3-ttsParameters
language_coderequiredstringLanguage of the input text as a BCP-47 code. Match the script's language so Hindi and Marathi (both Devanagari) are not confused.
"hi-IN""hi-IN""bn-IN""ta-IN""te-IN""kn-IN""ml-IN""mr-IN""gu-IN""pa-IN""od-IN"textrequiredstringText to synthesize, up to 2,500 characters; write Indic words in native script, code-mixed English is fine. Comma-format long numbers for accurate reading.
output_audio_codecoptionalstringAudio container of the response. Use wav for editing, mp3 for web delivery, mulaw or alaw for telephony.
"wav""wav""mp3""aac""flac""opus""linear16""mulaw""alaw"paceoptionalnumberSpeaking speed multiplier, from 0.5 to 2.0. Keep 1.0 for natural delivery; lower for narration, higher for brisk alerts.
1Range: 0.5 - 2speakeroptionalstringVoice used for synthesis, chosen from 37 studio speakers with lowercase names. Every speaker voices all eleven languages; pick per brand, gender, or region.
"shubh""shubh""aditya""rahul""rohan""amit""dev""ratan""varun""manan""sumit"speech_sample_rateoptionalintegerOutput sample rate in Hz. Use 8000 for telephony, 24000 as default, 44100 or 48000 for studio-quality output.
240008000160002205024000320004410048000temperatureoptionalnumberExpressiveness of the delivery, from 0.01 to 2.0. Lower is flat and consistent; higher is varied and emotive.
0.6Range: 0.01 - 2Response Type
Returns: Audio
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/sarvam-bulbul-v3-ttsSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
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