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

# Transcribe Audio

> Transcribe audio files to text using Whisper. Supports 99 languages and subtitle export.

<ParamField body="model" type="string" required>
  Transcription model. Currently: `whisper-1`.
</ParamField>

<ParamField body="file" type="file" required>
  Audio file to transcribe. Supported: `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `wav`, `webm`. Max 25MB.
</ParamField>

<ParamField body="language" type="string">
  ISO-639-1 language code (e.g. `en`, `ja`, `fr`, `de`, `es`). Providing this improves accuracy and speed.
</ParamField>

<ParamField body="prompt" type="string">
  Optional text to guide the model's style or continue a previous segment.
</ParamField>

<ParamField body="response_format" type="string" default="json">
  Output format. Options: `json`, `text`, `srt` (subtitles), `vtt` (web subtitles), `verbose_json`.
</ParamField>

<ParamField body="temperature" type="number" default="0">
  Sampling temperature `0`–`1`. `0` for deterministic output.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://www.samuraiapi.in/v1/audio/transcriptions \
    -H "Authorization: Bearer $SAMURAI_API_KEY" \
    -F model="whisper-1" \
    -F file="@podcast.mp3" \
    -F language="en" \
    -F response_format="text"
  ```

  ```python Python theme={null}
  with open("podcast.mp3", "rb") as f:
      transcript = client.audio.transcriptions.create(
          model="whisper-1",
          file=f,
          language="en",
          response_format="text"
      )
  print(transcript)
  ```

  ```python SRT subtitles theme={null}
  with open("video.mp4", "rb") as f:
      srt = client.audio.transcriptions.create(
          model="whisper-1",
          file=f,
          response_format="srt"
      )
  with open("subtitles.srt", "w") as out:
      out.write(srt)
  ```
</RequestExample>

<ResponseExample>
  ```json JSON format theme={null}
  {
    "text": "Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway."
  }
  ```

  ```text Text format theme={null}
  Welcome to Samurai AI. Today we're going to talk about building AI-powered applications using our unified API gateway.
  ```

  ```text SRT format theme={null}
  1
  00:00:00,000 --> 00:00:04,500
  Welcome to Samurai AI.

  2
  00:00:04,500 --> 00:00:09,200
  Today we're going to talk about building AI-powered applications.
  ```
</ResponseExample>
