# Speech to Text

> Munsit converts spoken Arabic into accurate, structured text — high-accuracy recognition across dialects and accents, with word-level timestamps, speaker diarization and meeting intelligence built on top.

## Your first transcription

One POST with a file. Munsit analyzes the recording, converts the Arabic speech to text, and returns the transcript with its duration and word-level timestamps.

```bash
curl -X POST "https://api.munsit.com/api/v1/audio/transcribe" \
  -H "x-api-key: $MUNSIT_API_KEY" \
  -F "file=@meeting.mp3"
```

```python
import requests, os

r = requests.post(
    "https://api.munsit.com/api/v1/audio/transcribe",
    headers={"x-api-key": os.environ["MUNSIT_API_KEY"]},
    files={"file": open("meeting.mp3", "rb")},
)
print(r.json()["data"]["transcription"])
```

```javascript
import fs from "node:fs";

const form = new FormData();
form.append("file", new Blob([fs.readFileSync("meeting.mp3")]), "meeting.mp3");

const res = await fetch(
  "https://api.munsit.com/api/v1/audio/transcribe",
  { method: "POST",
    headers: { "x-api-key": process.env.MUNSIT_API_KEY },
    body: form }
);
const { data } = await res.json();
console.log(data.transcription);
```

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"mime/multipart"
	"net/http"
	"os"
)

func main() {
	var buf bytes.Buffer
	w := multipart.NewWriter(&buf)
	f, _ := os.Open("meeting.mp3")
	fw, _ := w.CreateFormFile("file", "meeting.mp3")
	io.Copy(fw, f)
	w.Close()

	req, _ := http.NewRequest("POST",
		"https://api.munsit.com/api/v1/audio/transcribe", &buf)
	req.Header.Set("x-api-key", os.Getenv("MUNSIT_API_KEY"))
	req.Header.Set("Content-Type", w.FormDataContentType())

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()

	var out map[string]any
	json.NewDecoder(resp.Body).Decode(&out)
	data := out["data"].(map[string]any)
	fmt.Println(data["transcription"])
}
```

Response

```
{
  "statusCode": 200,
  "data": {
    "transcriptionId": "805059bf-7c3f-4a1e-9d2b-1f0c6ae83b47",
    "transcription": "لك كلما عمقت الآخرين أصبحت قزما...",
    "duration": 53.661375,
    "timestamps": [
      { "word": "الأشياء", "start": 0.24, "end": 0.31 }
    ]
  },
  "message": "Success"
}
```

> No dialect parameter. Munsit is optimized for Arabic speech recognition with strong coverage of dialect and accent variation — the same call handles all of it. For speakers who mix Arabic and English mid-sentence, switch to the munsit-en-ar model below.

## Choose a model

Two models. Every **batch** endpoint accepts an optional `model` parameter; if omitted, `munsit` is used. Live streaming takes the same `model` values. The [transcribe](/speech-to-text/transcribe#language) endpoint and live streaming also accept an optional `language`: with `munsit-en-ar` it is `auto` (the default), or `ar` / `en` to set the main language of the speech; every value still handles mixed Arabic-English speech. `munsit` is Arabic only (`ar`). Custom vocabulary (`hotwords`) works with both models in batch; in live streaming only `munsit` applies it — on `munsit-en-ar` the hotwords you send come back in `Metadata.dropped_hotwords`.

| Model | ID | Use it for | Default |
| --- | --- | --- | --- |
| **Munsit** | `munsit` | **Arabic.** Optimized for Arabic speech recognition, with strong performance across dialects and accents. | Yes |
| **Munsit En-Ar** | `munsit-en-ar` | **Mixed Arabic–English spoken content** with code-switching support — for speakers who naturally alternate between the two languages within the same conversation or utterance. | — |

## What you can send

Twelve audio formats, covering common output from different recording platforms — no transcoding step. Upload the file, or pass a public `audio_url` and let Munsit fetch it — see [choosing a source](/speech-to-text/transcribe#source).

.mp3.wav.m4a.flac.ogg.opus.webm.aac.amr.wma.mp2.m4r

| Workflow | Duration limit | Notes |
| --- | --- | --- |
| **Audio transcription** | Under 60 minutes | Pre-recorded files, word-level timing. |
| **Minutes of meetings** | Under 30 minutes | Structured transcripts optimized for meeting use cases. |
| **Live streaming** | No limit | Unbounded while the connection stays active. Keep the session alive with `KeepAlive` during pauses; unbroken speech is force-segmented about every 60 seconds. |

> Longer recordings? For Audio Transcription or Minutes of Meetings, split the audio into shorter segments for best performance.
> Sending more data than the model reads. Recognition runs on 16 kHz mono audio, so anything above that is downsampled on arrival. Higher sample rates, stereo channels and uncompressed WAV only add upload time. If your source is larger than it needs to be, encoding to mono 16 kHz before sending cuts transfer time with no effect on the transcript.

## Go further

Three core workflows plus real-time streaming.

- [Transcribe →](/speech-to-text/transcribe) — Convert pre-recorded audio files into text with word-level timing. Full parameter and response reference. — `POST /audio/transcribe`

- [Live streaming →](/speech-to-text/streaming) — Real-time transcription over a WebSocket, with interim results, turn detection, and per-turn sentiment and gender. — `WSS /api/v1/listen`

- [Diarization →](/speech-to-text/diarization) — Identify who spoke and get speaker-labeled transcript segments merged with timing. — `POST /audio/diarization/transcribe`

- [Minutes of meetings →](/speech-to-text/minutes-of-meetings) — Structured transcripts optimized for meeting records and downstream analysis. — `POST /minutes-of-meeting/transcribe`
