> ## Documentation Index
> Fetch the complete documentation index at: https://60db.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Speech to Text

> Transcribe audio to text

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  multipart/form-data
</ParamField>

### Form Data

<ParamField body="audio" type="file" required>
  Audio file to transcribe - Supported formats: MP3, WAV, FLAC, OGG, M4A - Max
  file size: 25MB - Max duration: 10 minutes
</ParamField>

<ParamField body="language" type="string">
  Language code for transcription (e.g., "en", "es", "fr"). If not specified,
  language will be auto-detected.
</ParamField>

<ParamField body="model" type="string" default="general">
  Transcription model: "general", "phone\_call", "meeting", "medical"
</ParamField>

<ParamField body="timestamps" type="boolean" default="false">
  Include word-level timestamps in the response
</ParamField>

<ParamField body="speaker_labels" type="boolean" default="false">
  Enable speaker diarization (identify different speakers)
</ParamField>

## Response

<ResponseField name="text" type="string">
  Transcribed text
</ResponseField>

<ResponseField name="language" type="string">
  Detected or specified language code
</ResponseField>

<ResponseField name="confidence" type="number">
  Confidence score (0-1)
</ResponseField>

<ResponseField name="duration" type="number">
  Audio duration in seconds
</ResponseField>

<ResponseField name="words" type="array">
  Word-level details (if timestamps enabled)
</ResponseField>

<ResponseField name="words[].word" type="string">
  Individual word
</ResponseField>

<ResponseField name="words[].start" type="number">
  Start time in seconds
</ResponseField>

<ResponseField name="words[].end" type="number">
  End time in seconds
</ResponseField>

<ResponseField name="words[].confidence" type="number">
  Word confidence score
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.60db.ai/stt \
    -H "Authorization: Bearer your-api-key" \
    -F "audio=@recording.mp3" \
    -F "language=en" \
    -F "timestamps=true"
  ```

  ```javascript JavaScript theme={null}
  import { SixtyDBClient } from "60db";

  const client = new SixtyDBClient("your-api-key");

  const file = document.querySelector('input[type="file"]').files[0];

  const result = await client.speechToText(file, {
    language: "en",
  });

  console.log("Transcription:", result.text);
  ```

  ```python Python theme={null}
  from sixtydb import SixtyDBClient

  client = SixtyDBClient('your-api-key')

  with open('recording.mp3', 'rb') as audio_file:
      result = client.speech_to_text(audio_file, language='en')
      print(f"Transcription: {result['text']}")
      print(f"Confidence: {result['confidence']}")
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "text": "Hello, this is a test of the speech to text API. It works great!",
    "language": "en",
    "confidence": 0.95,
    "duration": 5.2,
    "words": [
      {
        "word": "Hello",
        "start": 0.0,
        "end": 0.5,
        "confidence": 0.98
      },
      {
        "word": "this",
        "start": 0.6,
        "end": 0.8,
        "confidence": 0.97
      }
    ]
  }
  ```
</ResponseExample>
