Developer Quickstart

Start Building In 5 Minutes.🚀

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 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="hi-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",
10 language_code="gu-IN"
11)
12
13print(response)

Next Steps

1

Explore Documentation

Check out our detailed API Reference for all available endpoints and options.

3

View Examples

Browse our Cookbook for some inspiration

4

Get Support

Join our Discord community or contact support for help.