Skip to main content

client.stt.transcribe(request)

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

From File Path

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

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

ParameterTypeRequiredDescription
filestring · Buffer · ReadableStreamYesAudio input — file path, buffer, or stream
fileNamestringWhen using Buffer/StreamFile name for format detection
model'scribe' · 'scribe-mini'NoTranscription model (default: scribe)
languagestringNoLanguage code (e.g. ur for Urdu)
domain'phone-commerce' · 'farming'NoDomain-specific model for better accuracy

Response

FieldTypeDescription
transcriptstringThe transcribed text