interface STTOptions {
    agentContext?: string;
    agentContextCarryover?: boolean;
    apiKey?: string;
    baseUrl: string;
    bufferSizeMs: number;
    continuousPartials?: boolean;
    domain?: string;
    encoding: STTEncoding;
    endOfTurnConfidenceThreshold?: number;
    filterProfanity?: boolean;
    formatTurns?: boolean;
    inactivityTimeout?: number;
    includePartialTurns?: boolean;
    interruptionDelay?: number;
    keytermsPrompt?: string[];
    languageCodes?: string | string[];
    languageDetection?: boolean;
    maxSpeakers?: number;
    maxTurnSilence?: number;
    minTurnSilence?: number;
    mode?: "min_latency" | "balanced" | "max_accuracy";
    previousContextNTurns?: number;
    prompt?: string;
    redactPii?: boolean;
    redactPiiPolicies?: string[];
    redactPiiSub?: PiiRedactionSubstitution;
    sampleRate: number;
    speakerLabels?: boolean;
    speechModel: STTModels;
    vadThreshold?: number;
    voiceFocus?: VoiceFocus;
    voiceFocusThreshold?: number;
}

Properties

agentContext?: string

Only supported with the Universal-3 Pro model family.

agentContextCarryover?: boolean

When the model supports it, let an AgentSession push each assistant reply into agentContext so it is carried into the model's conversation context. Defaults to true for Universal-3 Pro models; set false to disable. Prior user turns are carried automatically by the model regardless of this flag. Ignored on models without context support.

apiKey?: string
baseUrl: string
bufferSizeMs: number

How large each chunk of audio is before being sent to AssemblyAI, in milliseconds. Corresponds to Python's buffer_size_seconds (seconds there, ms here per this repo's time-unit convention).

continuousPartials?: boolean

Emit additional partial transcripts during long turns. Universal-3 Pro only.

domain?: string
encoding: STTEncoding
endOfTurnConfidenceThreshold?: number
filterProfanity?: boolean

Filter profanity from transcripts. Connect-time only.

formatTurns?: boolean
inactivityTimeout?: number

Session inactivity timeout in seconds. AssemblyAI accepts integer values from 5 to 3600; when unset, no inactivity timeout is applied.

includePartialTurns?: boolean

Emit partial (non-final) turns. AssemblyAI defaults this to true, or false when redactPii is enabled. Connect-time only.

interruptionDelay?: number

Delay before the first early partial is emitted, in milliseconds. Universal-3 Pro only.

keytermsPrompt?: string[]
languageCodes?: string | string[]

Languages to steer transcription toward. Universal-3 Pro only.

languageDetection?: boolean
maxSpeakers?: number
maxTurnSilence?: number

Maximum silence (ms) before end-of-turn is forced regardless of confidence.

minTurnSilence?: number

Minimum silence (ms) before a confident end-of-turn is finalized.

mode?: "min_latency" | "balanced" | "max_accuracy"

Accuracy/latency preset for the Universal-3 Pro model family: min_latency, balanced, or max_accuracy. Explicit turn-silence values still take precedence over mode defaults.

previousContextNTurns?: number

Only supported with the Universal-3 Pro model family. Set at connection time only.

prompt?: string

Only supported with the Universal-3 Pro model family.

redactPii?: boolean

Redact PII from final turns. AssemblyAI disables partial turns when this is enabled unless includePartialTurns is set; partials are never redacted. Connect-time only.

redactPiiPolicies?: string[]

PII policies to redact, such as person_name or phone_number. Redacts all detected PII when unset. Requires redactPii. Connect-time only.

Replacement for redacted PII: hash (AssemblyAI default) or entity_name, which writes [PERSON_NAME]-style placeholders. Requires redactPii. Connect-time only.

sampleRate: number
speakerLabels?: boolean

Enable speaker diarization; the turn's speaker label is surfaced as speakerId.

speechModel: STTModels

Model selected at construction. Create a new STT to switch models.

vadThreshold?: number
voiceFocus?: VoiceFocus

Isolate the primary voice and suppress background noise. Connect-time only.

voiceFocusThreshold?: number

Background audio suppression aggressiveness, from 0.0 to 1.0. Connect-time only.