Skip to navigation

Welcome to Sarvam AI API Reference Documentation

View as Markdown

Sarvam provides Models & APIs across the stack to help developers build powerful applications. Whether you’re looking for chat completion, text translation, speech-to-text conversion, or a combination of speech recognition and translation, Sarvam has you covered.

Key Features

Available APIs: Chat Completion, Text Translation, Document Translation, Speech to Text, Speech to Text Translate, Text to Speech, Voice Cloning, Transliteration, and Language Identification.

Chat Completion

Use the /chat/completions endpoint or the SDK to generate conversational responses. Supports 10 Indic languages along with English, delivering best-in-class multilingual performance.

Translate Text

Use the /translate endpoint or the SDK to translate text from one language to another. Supports 22 Indic languages along with English, achieving best-in-class performance.

Document Translation

Use the /translate/document/jobs endpoints or the SDK to translate whole PDF, Word, Excel, PowerPoint, and HTML files. Exports preserve layout and stay in the source format (document-to-document).

Speech to Text

Use the /speech-to-text endpoint or the SDK to convert spoken language into written text. Output is returned in the same input language.

Speech to Text Translate

Use the /speech-to-text-translate endpoint or the SDK to combine speech recognition and translation, allowing you to convert spoken language directly into translated text.

Text to Speech

Use the /text-to-speech endpoint or the SDK to convert written text into spoken words. Supports natural-sounding voices across 10 languages.

Voice Cloning

Create a saved voice with /voices/create, then generate speech with /voices/clone and its voice_id.

Transliterate

Use the /transliterate endpoint or the SDK to convert text between different scripts while maintaining the same language. Perfect for handling multiple writing systems.

Language Identification

Use the /text-lid endpoint or the SDK to automatically identify the language of input text. Supports all major Indian languages with high accuracy.

Getting Started

To get started with Sarvam APIs, follow these steps:

  1. Authenticate: Learn how to authenticate your API requests in the Authentication Guide.
  2. Meta Prompt: You can now use our Meta Prompt directly to guide any AI chat model with the context needed to use Sarvam’s APIs effectively. An example on AI Studio with Gemini’s latest model: Explore here
  3. Try Examples: Use the Usage Guides to see examples and best practices.
  4. Manage your data: control how long request/response data from these APIs is kept. Set a workspace default and an optional per-product override in Data retention.

Need Help?

If you have any questions or need assistance, visit our Help section. Building with Sarvam? Join our Discord for early access to new releases, biweekly challenges, office hours with the team, and India’s AI builder community.