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

# Speech to Text

> Transcribe audio files with client.stt.transcribe()

## `client.stt.transcribe(request)`

Transcribe audio to text. Accepts a file path, `Buffer`, or readable stream.

### From File Path

```typescript theme={null}
import UpliftAI from '@upliftai/sdk-js';

const client = new UpliftAI({
  apiKey: 'your-api-key',
});

const { transcript } = await client.stt.transcribe({
  file: './recording.mp3',
  model: 'scribe',
  language: 'ur',
});

console.log(transcript);
```

### From Buffer

```typescript theme={null}
import UpliftAI from '@upliftai/sdk-js';
import { readFileSync } from 'fs';

const client = new UpliftAI({
  apiKey: 'your-api-key',
});

const buffer = readFileSync('./recording.mp3');

const { transcript } = await client.stt.transcribe({
  file: buffer,
  fileName: 'recording.mp3', // required for format detection
  model: 'scribe',
  language: 'ur',
});
```

### Request Parameters

| Parameter  | Type                               | Required                 | Description                                |
| ---------- | ---------------------------------- | ------------------------ | ------------------------------------------ |
| `file`     | `string · Buffer · ReadableStream` | Yes                      | Audio input — file path, buffer, or stream |
| `fileName` | `string`                           | When using Buffer/Stream | File name for format detection             |
| `model`    | `'scribe' · 'scribe-mini'`         | No                       | Transcription model (default: `scribe`)    |
| `language` | `string`                           | No                       | Language code (e.g. `ur` for Urdu)         |
| `domain`   | `'phone-commerce' · 'farming'`     | No                       | Domain-specific model for better accuracy  |

### Response

| Field        | Type     | Description          |
| ------------ | -------- | -------------------- |
| `transcript` | `string` | The transcribed text |
