Developer Quickstart

Get started with Sarvam APIs in under a minute using just a few lines of code

1

Create an API Key

Visit the Sarvam AI dashboard and create a new API key. Keep this key secure - you’ll need it to authenticate your requests.

2

Set Up Your Environment

Export your API key as an environment variable:

$export SARVAM_API_KEY="your_api_key_here"
3

Install the SDK

Choose your preferred language and install our SDK:

$pip install -U sarvamai
4

Make Your First API Call

1from sarvamai import SarvamAI
2
3client = SarvamAI(
4 api_subscription_key="YOUR_API_KEY",
5)
6
7response = client.text.translate(
8 input="Hi, My Name is Vinayak.",
9 source_language_code="auto",
10 target_language_code="gu-IN",
11 speaker_gender="Male"
12)
13
14print(response)

Quick Tips: - Store your API key securely and never commit it to version control - Use environment variables or a secure configuration manager

Sarvam AI APIs

1from sarvamai import SarvamAI
2
3client = SarvamAI(
4 api_subscription_key="YOUR_SARVAM_API_KEY",
5)
6
7response = client.speech_to_text.transcribe(
8 file=open("audio.wav", "rb"),
9 model="saarika:v2.5",
10 language_code="gu-IN"
11)
12
13print(response)

Next Steps

1

Learn More about our Models

Explore Sarvam AI’s specialized Models for Indian languages - from speech processing to text generation and translation.

2

Explore API Capabilities

Discover our comprehensive API Capabilities for speech technologies, text processing, and analytics.

3

View Examples

Browse our Cookbook for some inspiration and step-by-step tutorials.

4

Discord

Join our Discord community for support, discussions, and updates.