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

# Speech-to-Text

The Speech-to-Text API converts spoken audio into accurate text with low latency. It supports both file-based transcription and real-time streaming, making it suitable for conversational AI, voice assistants, telephony, and other speech-enabled applications.

## OpenAI Compatibility

The Speech-to-Text API is fully compatible with the OpenAI Audio Transcriptions API. Existing OpenAI integrations can switch to Sarj by updating the base URL and API key while using the same request format and response structure.

## Base URL

`https://stt-rnnt-ar.sarj.ai/openai/v1`

## Endpoint

`POST /audio/transcriptions`

## Authentication

All requests require an API key.

Include your API key in the `Authorization` header of every request.

**Authorization:** `Bearer YOUR_API_KEY`

## Request Format

The endpoint accepts `multipart/form-data` requests.

### Parameters

| Parameter            | Required | Description                                                                 |
| :------------------- | :------- | :-------------------------------------------------------------------------- |
| **file**             | Yes      | Audio file to transcribe.                                                   |
| **model**            | Yes      | The model to use for transcription. Use `conformer`.                        |
| **language**         | No       | Language code. Use `ar` for Arabic.                                         |
| **response\_format** | No       | Supported values are `json`, `text`, and `verbose_json`. Default is `json`. |

## Audio Requirements

For the best transcription quality, we recommend:

* **Sample Rate:** 16 kHz
* **Channels:** Mono
* **Encoding:** PCM WAV

Other common audio formats and sample rates are also supported and will be processed automatically.

## Streaming

The Speech-to-Text API supports both:

* **Batch transcription** for complete audio files.
* **Real-time streaming** for low-latency transcription of live audio.

## Example Request

Send a `POST` request to:

`https://stt-rnnt-ar.sarj.ai/openai/v1/audio/transcriptions`

Include:

* An `Authorization` header containing your API key.
* A `multipart/form-data` body containing the audio file and request parameters.

## Response

The API returns the transcription in the requested response format. The default response format is `json`.

##

##
