> ## Documentation Index
> Fetch the complete documentation index at: https://www.bolna.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build an Urdu voice agent on Bolna

> Build an Urdu voice agent on Bolna: the transcribers and voices that support Urdu, its language code, starting calls in Urdu, and an API example.

An Urdu voice agent on Bolna is a regular agent whose transcriber (speech-to-text) and voice (text-to-speech) are both set to Urdu, with a prompt written in Urdu (Perso-Arabic) script. This page lists the providers whose Bolna docs confirm Urdu support, the language code to send, and a minimal API example.

Bolna's language code for Urdu is `ur`. Urdu is one of the languages Bolna [detects automatically](https://www.bolna.ai/docs/customizations/supported-languages#languages-with-automatic-detection) mid-call.

If you want one agent that handles both English and Urdu on the same call, start here for the Urdu side, then follow [Set up multilingual voice AI agents](https://www.bolna.ai/docs/customizations/multilingual-languages-support). For every language, see the [languages overview](https://www.bolna.ai/docs/customizations/languages/overview).

***

## Choose an Urdu transcriber

The transcriber turns the caller's Urdu speech into text. Send the plain code `ur` as `transcriber.language`, not a locale such as `ur-IN` ([Create Agent](https://www.bolna.ai/docs/api-reference/agent/v2/create.md#transcriber)).

| Provider | `provider` / `model` | Urdu notes |
| - | - | - |
| [AssemblyAI](https://www.bolna.ai/docs/assemblyai.md) | `assembly` / `universal-3-6-pro` | Urdu is one of 32 languages it code-switches across. It needs `universal-3-6-pro`, since `universal-3-5-pro` does not cover Urdu. |

Sarvam does not accept Urdu through Bolna yet (see [Notes](#notes)). Compare all transcribers in [Choosing a speech-to-text provider](https://www.bolna.ai/docs/concepts/choosing-speech-to-text.md).

***

## Choose an Urdu voice

The voice (synthesizer) speaks the agent's replies. Most providers require `language` inside `provider_config`, so set it to `ur` ([Create Agent](https://www.bolna.ai/docs/api-reference/agent/v2/create.md#synthesizer)).

| Provider | `provider` / `model` | Urdu notes |
| - | - | - |
| [Soniox](https://www.bolna.ai/docs/soniox-voice.md) | `soniox` / `tts-rt-v2` | Urdu is one of its ten Indian languages. `language` is required. |

Voice catalogs change over time. Confirm a valid `model` and `voice_id` pair with [List voices](https://www.bolna.ai/docs/api-reference/voice/get_all.md), or preview voices in the [Languages tab](https://www.bolna.ai/docs/agent-setup/audio-tab.md). See [Choosing a text-to-speech provider](https://www.bolna.ai/docs/concepts/choosing-text-to-speech.md) for a wider comparison.

***

## Write the prompt for Urdu

* **Write in Urdu (Perso-Arabic) script, not romanized Urdu.** `السلام علیکم! آپ کیسے ہیں؟` rather than `Assalam-o-alaikum! Aap kaise hain?`. Native script gives more accurate pronunciation and stops the text being treated as English.
* **Keep common English loanwords in Latin script.** Callers say "order", "OTP" and "support ticket" in English, so keep those words as they are inside Urdu (Perso-Arabic) script text instead of forcing a pure Urdu translation.
* **Set gender and politeness explicitly.** These are often carried by verb forms, so name the forms you want for the agent's persona rather than writing "be polite".
* **Read alphanumerics character by character, in English.** For OTPs, registration numbers and order IDs, this avoids misheard and mispronounced digits.
* **Leave language switching out of the prompt.** Bolna switches languages itself.

The full guidance, with examples, is in [Writing prompts in non-English languages](https://www.bolna.ai/docs/writing-prompts-in-non-english-languages.md).

***

## Create an Urdu agent over the API

This uses the same body shape as the [API quickstart](https://www.bolna.ai/docs/quickstarts/api.md), with AssemblyAI for transcription and Soniox for the voice.

**1. Write the agent config**

Save this as `agent.json`:

```json theme={"system"}
{
  "agent_config": {
    "agent_name": "Urdu Support Agent",
    "agent_welcome_message": "السلام علیکم! میں آپ کی کیا مدد کر سکتی ہوں؟",
    "tasks": [{
      "task_type": "conversation",
      "toolchain": { "execution": "sequential", "pipelines": [["transcriber", "llm", "synthesizer"]] },
      "tools_config": {
        "llm_agent": {
          "agent_type": "simple_llm_agent",
          "agent_flow_type": "streaming",
          "llm_config": { "provider": "openai", "model": "gpt-4.1-mini", "max_tokens": 150, "temperature": 0.2 }
        },
        "transcriber": {
          "provider": "assembly",
          "model": "universal-3-6-pro",
          "language": "ur",
          "stream": true,
          "endpointing": 150,
          "keywords": "Bolna, PhonePe, Flipkart",
          "context": "Inbound support line for an electronics retailer in India. Callers ask about order status and returns, and often read out order numbers."
        },
        "synthesizer": {
          "provider": "soniox",
          "provider_config": {
            "voice": "Priya",
            "voice_id": "Priya",
            "model": "tts-rt-v2",
            "language": "ur"
          },
          "stream": true,
          "buffer_size": 400
        },
        "input": { "provider": "plivo", "format": "wav" },
        "output": { "provider": "plivo", "format": "wav" }
      },
      "task_config": { "call_terminate": 90, "hangup_after_silence": 10 }
    }]
  },
  "agent_prompts": {
    "task_1": {
      "system_prompt": "آپ ایک مددگار سپورٹ ایجنٹ ہیں۔ مختصر جواب دیں۔"
    }
  }
}
```

Soniox addresses built-in voices by name, so `voice` and `voice_id` carry the same value. The docs don't name an Urdu-specific Soniox voice, so treat `Priya` as a placeholder and pick a voice that suits Urdu callers in the [Languages tab](https://www.bolna.ai/docs/agent-setup/audio-tab.md) or with [List voices](https://www.bolna.ai/docs/api-reference/voice/get_all.md).

**2. Create the agent**

```bash curl theme={"system"}
curl https://api.bolna.ai/v2/agent \
  -H "Authorization: Bearer $BOLNA_API_KEY" \
  -H "Content-Type: application/json" \
  -d @agent.json
```

```python Python theme={"system"}
import os, urllib.request, json

with open("agent.json") as f:
    body = json.load(f)

req = urllib.request.Request(
    "https://api.bolna.ai/v2/agent",
    data=json.dumps(body).encode(),
    headers={"Authorization": f"Bearer {os.environ['BOLNA_API_KEY']}",
             "Content-Type": "application/json"},
)
print(json.load(urllib.request.urlopen(req)))
```

The response contains the new `agent_id`.

**3. Place a test call**

Call the agent with [`POST /call`](https://www.bolna.ai/docs/api-reference/calls/make), as in the [API quickstart](https://www.bolna.ai/docs/quickstarts/api.md), and check the transcript with [`GET /executions/{id}`](https://www.bolna.ai/docs/api-reference/executions/get_execution).

To use another provider, swap the `transcriber` or `synthesizer` block for one from the provider's page. Every combination is validated when you create the agent: an unsupported transcriber `model` and `language` pair returns `400 Provided language: <language> is not available for the model: <model>`.

***

## Improve recognition with keywords and context

Brand names, product names and place names are where Urdu transcription most often goes wrong. Bolna has two transcriber fields for this:

* `keywords`: a comma-separated list of terms callers say.
* `context`: a sentence or two describing the call.

Support for Urdu transcribers:

* **AssemblyAI**: reads both. Up to 100 terms, and `context` up to 1,750 characters.

See [Keywords and context](https://www.bolna.ai/docs/customizations/asr-keywords-and-context.md) for the full provider support table and how to write good terms.

***

## Serve Urdu and English on one agent

Many callers move between Urdu and English. Bolna handles this in two ways:

* **Code-mixing within a sentence.** AssemblyAI `universal-3-6-pro` code-switches across its 32 languages, so a caller who mixes Urdu and English mid-sentence is handled without changing configuration. A sentence with a few English words is still treated as Urdu.
* **A full language switch.** Add both English and Urdu to one agent with [`multilingual_config`](https://www.bolna.ai/docs/customizations/multilingual-config-reference), each with its own transcriber, voice and prompt. Urdu is one of the languages Bolna [detects automatically](https://www.bolna.ai/docs/customizations/supported-languages#languages-with-automatic-detection), so with the default "requested or auto detected" trigger the agent follows a caller who moves into Urdu. The [multilingual quickstart](https://www.bolna.ai/docs/quickstarts/multilingual.md) shows the API shape.

On a multilingual agent, you can also:

* [Start a call in Urdu](https://www.bolna.ai/docs/customizations/start-call-in-language.md) with `"agent_data": { "language": "ur" }` on `POST /call`, or an `agent_language` column set to `ur` in a batch CSV. Inbound calls can return `agent_language` from your caller data source.
* Let system messages such as the hangup and "are you still there?" checks [follow the active language](https://www.bolna.ai/docs/customizations/auto-switch-multilingual-messages.md).
* Read [How language switching works](https://www.bolna.ai/docs/customizations/language-switching-behavior.md) for what does and doesn't trigger a switch.

> [!NOTE]
>
> Hindi, Marathi and Urdu are look-alike languages, so Bolna decides a switch between them from the grammar of the whole sentence. Configure every language your callers use, each with its own voice and transcriber.

***

## Notes

* Sarvam's Saaras models cover Urdu on Sarvam's own API, but Urdu is not yet available through Bolna on Sarvam. `"language": "ur"` on `saaras:v4` or `saaras:v3` fails agent creation with `400 Provided language: ur is not available for the model: <model>`.
* Use AssemblyAI `universal-3-6-pro` to transcribe Urdu. `universal-3-5-pro` does not cover it.
* Soniox `tts-rt-v2` is the only voice provider whose page lists Urdu. The [Cartesia](https://www.bolna.ai/docs/cartesia.md) page notes that Urdu is not yet selectable in Bolna on `sonic-3.6`.

***

## Phone numbers for Urdu agents in India

* [Buy an Indian number](https://www.bolna.ai/docs/buying-phone-numbers) in the dashboard through Plivo or Vobiz.
* For commercial or telemarketing calls in India, read [How to get 140 & 160-series phone numbers in India](https://www.bolna.ai/docs/obtaining-regulated-phone-numbers.md) for the TRAI and DLT requirements.
* To use numbers from your own carrier, connect it with a [SIP trunk](https://www.bolna.ai/docs/sip-trunking/overview#using-sip-trunks-in-india).

***

## Next steps

> [card] [Languages overview](https://www.bolna.ai/docs/customizations/languages/overview)
>
> Every language with a guide, and its providers

> [card] [Multilingual setup](https://www.bolna.ai/docs/customizations/multilingual-languages-support)
>
> Indian language support by provider, and per-language voices and prompts

> [card] [AssemblyAI speech-to-text](https://www.bolna.ai/docs/assemblyai.md)
>
> Universal-3.6 Pro, its 32 languages and biasing limits

> [card] [Soniox text-to-speech](https://www.bolna.ai/docs/soniox-voice.md)
>
> tts-rt-v2, named voices and required settings

> [card] [Start a call in a language](https://www.bolna.ai/docs/customizations/start-call-in-language.md)
>
> Pick the opening language per call, batch row or inbound caller

> [card] [How language switching works](https://www.bolna.ai/docs/customizations/language-switching-behavior.md)
>
> What does and doesn't trigger a mid-call switch


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.