Developer Quickstart
Get started with Sarvam APIs in 30 seconds: create a key, install the SDK, and make your first call with just a few lines of code.
Prerequisites:
- A Sarvam AI account and API key. Create one on the dashboard if you don’t have one yet.
- Python 3.9+ or Node.js 18+ (or skip both and call the REST API directly with
curl).
By the end of this quickstart, you’ll have made a live call to a Sarvam AI API and gotten back a real result: a transcript, a playable audio file, a translation, or a chat reply, depending on which API you try below.
Setup
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.
Install the SDK
Choose your preferred language and install our SDK. Need a different language or an older version? See Libraries & SDKs.
Make Your First API Call
Here’s a Chat Completion example using the key and SDK you just set up. Paste it in and run it:
Prefer Speech to Text, Text to Speech, or Translation instead? Jump to Try an API below, each comes with its own Python, JavaScript, and cURL example.
Keep your key safe. Store it in an environment variable or a secrets manager, and never commit it to version control. Getting a 403? See Authentication. Getting a 429? See Credits & Rate Limits. Any other error code is listed in Errors & Troubleshooting.
Try an API
Sarvam AI covers four core capabilities below. Pick a tab, and copy-paste your way to a working call.
Speech to Text
Text to Speech
Text Translation
Chat Completion
Saaras v3 is our latest speech recognition model. It supports multiple output modes: transcribe (default, original language), translate (to English), verbatim (word-for-word), translit (romanization), and codemix (mixed script).
Use transcribe for same-language output, translate to convert audio to English text, or verbatim/translit/codemix for specialized formatting. mode defaults to transcribe when omitted.
Next Steps
Pick up where you left off, based on the API you just tried: