# Sarvam (/en/ai/platform/models/asr/sarvam)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-guides-v2.txt).


Sarvam ASR provides real-time speech-to-text with low latency and reliable performance for Indian languages.

## Sample configuration

The following example shows how to configure Sarvam as the agent's ASR when you create or update an agent. For a complete example, see [Create an agent and start a session](/en/ai/platform/get-started/start-stop-agent#create-an-agent).

Sarvam supports BYOK only. It isn't available in managed mode. Store your Sarvam API key in a secret set, and refer to it from the agent. For details, see [Use your own provider keys](/en/ai/platform/build/use-your-own-keys).

**Python SDK**

```python
from agora_agent import Agent, SarvamSTT, secret_ref

# client is your configured Agora client
agent = (
    Agent(client=client)
    .with_stt(
        SarvamSTT(
            api_key=secret_ref("support_prod", "sarvam"),
            language="hi-IN",
        )
    )
    .with_llm(...)  # configure your LLM vendor
    .with_tts(...)  # configure your TTS vendor
)
```

**TypeScript SDK**

```ts
import { Agent, SarvamSTT, secretRef } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(
    new SarvamSTT({
      apiKey: secretRef('support_prod', 'sarvam'),
      language: 'hi-IN',
    }),
  )
  .withLlm(/* configure your LLM vendor */)
  .withTts(/* configure your TTS vendor */);
```

**Go SDK**

```go
// client is your configured Agora client
agent := agentkit.NewAgent(client).
	WithStt(vendors.NewSarvamSTT(vendors.SarvamSTTOptions{
		APIKey:   agentkit.SecretRef("support_prod", "sarvam"),
		Language: "hi-IN",
	})).
	WithLlm( /* configure your LLM vendor */ ).
	WithTts( /* configure your TTS vendor */ )
```

**REST API**

Set `credential.mode` to `byok` and `credential.fields.api_key` to a reference to your Sarvam API key in a secret set. In the following example, the key is stored as `sarvam` in the `support_prod` set:

```json
"asr": {
  "credential": {
    "mode": "byok",
    "fields": {
      "api_key": "$secrets.support_prod.sarvam"
    }
  },
  "vendor": "sarvam",
  "language": "hi-IN",
  "params": {
    "language": "hi-IN"
  }
}
```

## Key parameters

The `asr` block takes the following fields. In the SDKs, `SarvamSTT` sets them from its options, and passes any other Sarvam parameters from its additional parameters option to `params`.

**asr required**

**`vendor` (string) required**

Set to `sarvam`.

**`credential` (object) required**

How the agent authenticates with Sarvam. Set `mode` to `byok` and `fields.api_key` to a `$secrets.<set>.<key>` reference to your Sarvam API key. Get your API key from the [Sarvam dashboard](https://dashboard.sarvam.ai/signin).

**`language` (string) required**

The language code for transcription, for example, `hi-IN`. Set to `unknown` for automatic language detection.

> **Caution**
>
> The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in `params` are passed through directly to Sarvam without validation. For a full list of supported options, refer to the [Sarvam documentation](https://docs.sarvam.ai/api-reference-docs/speech-to-text/transcribe).

This integration is fully supported for use with the Conversational AI Platform. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
