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

# Speech To Text

> Speech-to-Text allow to convert audio into written transcription in multiple languages.

## Request

Make a `POST` request to below endpoint and pass the required parameters as a request body.

```curl curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
--request POST 'https://modelslab.com/api/v1/enterprise/speech_to_text/transcribe' \
```

## Body

```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "key": "enterprise_api_key",
  "init_audio": "https://assets.modelslab.ai/generations/9ab0c784-65ec-41b3-a646-99dfe16b053b.mp3",
  "language": "en",
  "timestamp_level": null,
  "webhook": null,
  "track_id": null
}
```

## Body Attributes

<ParamField query="key" type="string" required>
  API key for authentication.
</ParamField>

<ParamField query="init_audio" type="string" required>
  The audio file to transcribe.
</ParamField>

<ParamField query="language" default="en" type="string">
  Language for the voice.\
  Allowed values: `af`, `ar`, `be`, `bn`, `bg`, `zh`, `cs`, `da`, `nl`, `en`, `fi`, `fr`, `de`, `el`, `he`, `hi`, `hu`, `id`, `it`, `ja`, `kn`, `ko`, `ml`, `mr`, `ne`, `pa`, `fa`, `pl`, `pt`, `ro`, `ru`, `sr`, `es`, `sv`, `tl`, `ta`, `te`, `th`, `tr`, `uk`, `ur`, `vi`, `cy`
</ParamField>

<ParamField query="timestamp_level" default="null">
  Timestamp level for the transcription.\
  Allowed values: `null`, `word`, `sentence`
</ParamField>

<ParamField query="webhook" type="string">
  URL to receive POST notification upon completion.
</ParamField>

<ParamField query="track_id" type="integer">
  ID for webhook identification.
</ParamField>

<Warning>
  **Timestamp Level Accuracy:** Sentence-level timestamps work well and provide reliable results. However, word-level timestamps may not be accurate and may provide less reliable results.
</Warning>

<Note>
  Whisper supports several languages, but performance may vary due to factors like limited training data, script complexity, and regional dialects, potentially affecting transcription accuracy.
</Note>

### Languages Supported

```
"Afrikaans": "af",
"Arabic": "ar",
"Belarusian": "be",
"Bengali": "bn",
"Bulgarian": "bg",
"Chinese": "zh",
"Czech": "cs",
"Danish": "da",
"Dutch": "nl",
"English": "en",
"Finnish": "fi",
"French": "fr",
"German": "de",
"Greek": "el",
"Hebrew": "he",
"Hindi": "hi",
"Hungarian": "hu",
"Indonesian": "id",
"Italian": "it",
"Japanese": "ja",
"Kannada": "kn",
"Korean": "ko",
"Malayalam": "ml",
"Marathi": "mr",
"Nepali": "ne",
"Panjabi": "pa",
"Persian": "fa",
"Polish": "pl",
"Portuguese": "pt",
"Romanian": "ro",
"Russian": "ru",
"Serbian": "sr",
"Spanish": "es",
"Swedish": "sv",
"Tagalog": "tl",
"Tamil": "ta",
"Telugu": "te",
"Thai": "th",
"Turkish": "tr",
"Ukrainian": "uk",
"Urdu": "ur",
"Vietnamese": "vi",
"Welsh": "cy"
```


## OpenAPI

````yaml POST /enterprise/speech_to_text/transcribe
openapi: 3.0.0
info:
  title: ModelsLab Enterprise API
  version: 1.0.0
  description: OpenAPI spec generated from provided MDX files.
servers:
  - url: https://modelslab.com/api/v1
security: []
paths:
  /enterprise/speech_to_text/transcribe:
    post:
      summary: 'Enterprise: Speech to Text Transcription Endpoint'
      description: This endpoint generates and returns text from audio.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranscribeRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
        '401':
          description: Unauthorized - Invalid API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TranscribeRequest:
      type: object
      properties:
        key:
          type: string
          description: Your API key
        init_audio:
          type: string
          description: The audio file to transcribe
        language:
          type: string
          description: Language for the transcription
          default: en
        timestamp_level:
          type: string
          description: Timestamp level for the transcription
          enum:
            - 'null'
            - word
            - sentence
          default: 'null'
        webhook:
          type: string
          description: URL to receive POST notification upon completion
        track_id:
          type: integer
          description: ID for webhook identification
      required:
        - key
        - init_audio
    GenericResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: Operation completed successfully
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Error message

````