Speech to Text - Uplift AI API Docs
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
| 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 |