interface STTOptions {
    apiKey?: string;
    enableDiarization: boolean;
    endpointing: number;
    interimResults: boolean;
    keyterm?: string[];
    language: string;
    sampleRate: number;
    smartTurn?: number;
    smartTurnTimeout?: number;
    vadThreshold?: number;
}

Properties

apiKey?: string
enableDiarization: boolean
endpointing: number

Silence duration in milliseconds before an utterance-final event is fired. xAI's default is 10ms, but we default to 100ms for better compatibility with LK EOT models.

interimResults: boolean
keyterm?: string[]

Key terms/phrases (max 100, 50 chars each) to bias transcription accuracy toward.

language: string
sampleRate: number
smartTurn?: number

Confidence threshold (0.0-1.0) for xAI's ML end-of-turn ("Smart Turn") prediction at silence boundaries. When unset, Smart Turn is left at xAI's default behavior.

smartTurnTimeout?: number

Maximum silence in milliseconds (1-5000) before an utterance-final event is forced even when Smart Turn predicts the speaker is continuing.

vadThreshold?: number

Voice-activity detection threshold, range 0.0-1.0. Lower values capture quieter/noisier speech. When unset, xAI's websocket default (0.08) applies.