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.

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
2
3client = SarvamAI(
4api_subscription_key="<YOUR_API_SUBSCRIPTION_KEY>"
5)
6
7response = client.text_to_speech.convert(
8inputs=["Welcome to Sarvam AI!"],
9model="bulbul:v2",
10speaker="anushka",
11target_language_code="en-IN",
12)

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.