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

# Supported Languages

> Languages supported by Speech to Text models

Hamsa STT supports two language codes:

| Code | Language | Notes                        |
| ---- | -------- | ---------------------------- |
| `ar` | Arabic   | All dialects — auto-detected |
| `en` | English  | —                            |

## Arabic dialect detection

When you set `language` to `ar`, the model automatically detects the specific Arabic dialect being spoken. You do not need to specify the dialect. Supported dialects include Egyptian, Gulf, Levantine, Iraqi, and others.

## Code-switching

The models handle speech that naturally switches between Arabic and English, which is common in many Arabic-speaking regions.

## Setting the language

### Batch API

Set the `language` field in your request body. Defaults to `ar` if omitted.

```json theme={null}
{
  "mediaUrl": "https://your-storage.com/audio.mp3",
  "model": "Hamsa-General-V2.0",
  "language": "ar"
}
```

### Realtime API

Set the `language` field in your request body. Defaults to `ar` if omitted.

```json theme={null}
{
  "audioBase64": "<base64-encoded-audio>",
  "language": "en"
}
```

### WebSocket

Set the `language` field in the STT payload. Defaults to `ar` if omitted.

```json theme={null}
{
  "type": "stt",
  "payload": {
    "audioBase64": "<base64-encoded-audio>",
    "language": "ar"
  }
}
```
