Text-to-Speech APIs

API Types

Real Time API

Generate speech for short text with immediate response. Best for quick conversions up to 1000 characters.

Model Information

Bulbul v2

Our flagship text-to-speech model designed for Indian languages and accents.

Key Features:

  • Natural-sounding speech with human-like prosody
  • Multiple voice personalities
  • Multi-language and code-mixed text support
  • Real-time synthesis capabilities
  • Fine-grained control over pitch, pace, and loudness
Language Support

Supports 11 Indian languages with BCP-47 codes:

Supported Languages:

  • English (en-IN)
  • Hindi (hi-IN)
  • Bengali (bn-IN)
  • Tamil (ta-IN)
  • Telugu (te-IN)
  • Kannada (kn-IN)
  • Malayalam (ml-IN)
  • Marathi (mr-IN)
  • Gujarati (gu-IN)
  • Punjabi (pa-IN)
  • Odia (or-IN)

Code Examples

Synchronous Processing

Convert text to speech with immediate response. Best for quick conversions and testing. Features include:

  • Instant audio generation
  • Multiple voice options
  • Support for SSML
  • Various audio formats
1from sarvamai import SarvamAI
2from sarvamai.play import save
3
4client = SarvamAI(api_subscription_key="YOUR_API_SUBSCRIPTION_KEY")
5# Convert text to speech
6audio = client.text_to_speech.convert(
7 target_language_code="en-IN",
8 text="Welcome to Sarvam AI!",
9 model="bulbul:v2",
10 speaker="anushka"
11 )
12save(audio, "output1.wav")

API Features

Key Features
  • Support for code-mixed text
  • Multiple speaker voices
  • Adjustable speech parameters
  • High-quality audio output
Output Format
  • Wave file format - Base64 encoded string - Configurable sample rates - Multiple quality options
Speech Parameters
  • Pitch control - Speech rate adjustment - Volume control - Language selection
Integration
  • Simple REST API
  • Multiple language SDKs
  • Comprehensive documentation
  • Easy-to-follow examples

Next Steps

1

Choose Your API

Select the appropriate API type based on your use case.

3

Get API Key

Sign up and get your API key from the dashboard.

4

Go Live

Deploy your integration and monitor usage in the dashboard.

Need help choosing the right API? Contact us on discord for guidance.