> This page is for Model APIs.

> Sarvam Voice Agents (Samvaad) is a voice AI agent platform for Indian languages: build, test and deploy AI calling agents on your own phone numbers, from ₹3 a minute. Start here: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Choose a model

> Choose between Bulbul v4 Flash and Bulbul v3 with the model parameter, and switch between them without changing anything else in your request.

Set the `model` parameter to choose a Bulbul model. Both models use the same request format, parameters, limits and APIs. What differs is the set of speakers.

|                           | `bulbul:v4-flash`                             | `bulbul:v3`                                                  |
| ------------------------- | --------------------------------------------- | ------------------------------------------------------------ |
| **When to use it**        | New integrations                              | Existing integrations, or when you want a short speaker name |
| **Speakers**              | 200+ persona IDs such as `simran_en_customer` | 37 names such as `shubh`                                     |
| **Default speaker**       | `shubh_enhi_ads`                              | `shubh`                                                      |
| **If `model` is omitted** |                                               | This is the default model                                    |

## Example

#### Python

```python
import os
from sarvamai import SarvamAI
from sarvamai.play import save

client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])

response = client.text_to_speech.convert(
    text="Welcome to Sarvam AI!",
    language_code="en-IN",
    model="bulbul:v4-flash",
    speaker="simran_en_customer",
)

save(response, "output.wav")
```

#### JavaScript

```javascript
import { SarvamAIClient } from "sarvamai";
import { writeFileSync } from "fs";

const client = new SarvamAIClient({
  apiSubscriptionKey: process.env.SARVAM_API_KEY,
});

const response = await client.textToSpeech.convert({
  text: "Welcome to Sarvam AI!",
  language_code: "en-IN",
  model: "bulbul:v4-flash",
  speaker: "simran_en_customer",
});

writeFileSync("output.wav", Buffer.from(response.audios[0], "base64"));
```

#### cURL

```bash
curl -X POST https://api.sarvam.ai/text-to-speech \
  -H "api-subscription-key: $SARVAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Welcome to Sarvam AI!",
    "language_code": "en-IN",
    "model": "bulbul:v4-flash",
    "speaker": "simran_en_customer"
  }' | jq -r '.audios[0]' | base64 --decode > output.wav
```

## Switch between models

Change `model` and `speaker` together. Nothing else in the request needs to change.

| From              | To                | What to change                                                                                                                                                                                      |
| ----------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bulbul:v3`       | `bulbul:v4-flash` | Set `model="bulbul:v4-flash"` and replace the speaker name with a persona ID. See the [v3 to v4 speaker mapping](/api/api-guides-tutorials/text-to-speech/best-practices#migrating-from-bulbul-v3). |
| `bulbul:v4-flash` | `bulbul:v3`       | Set `model="bulbul:v3"` and use a v3 speaker name such as `shubh`.                                                                                                                                  |

> **Warning**
>
> Speakers are not shared between models. A v3 name on `bulbul:v4-flash`, or a v4 persona ID on `bulbul:v3`, returns HTTP `400`.

## Common errors

| Request                                             | Error                                                                                                            |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| v3 speaker on v4 Flash (for example `shubh`)        | `Speaker 'shubh' is not compatible with model bulbul:v4-flash. Available speakers for bulbul:v4-flash are: ...`  |
| v4 persona on v3 (for example `simran_en_customer`) | `Speaker 'simran_en_customer' is not compatible with model bulbul:v3. Available speakers for bulbul:v3 are: ...` |
| Removed model `bulbul:v2`                           | Returns HTTP `400`.                                                                                              |

The error lists every speaker the model accepts. To hear them first, see [Voices](/api/api-guides-tutorials/text-to-speech/voices).