Skip to content

RevAISTTConfig

Configuration options for the RevAISTT provider.

Defined in: src/providers/stt/revai/RevAISTT.ts:51

Configuration options for the RevAISTT provider.

Remarks

Extends STTProviderConfig with Rev AI-specific settings. You must provide either apiKey (for direct browser-to-Rev AI connections) or proxyUrl (for a server-side proxy that injects the access token). If both are provided, proxyUrl takes precedence.

Rev AI authenticates the streaming WebSocket via an access_token query parameter. In direct mode the resolved apiKey is placed on the connection URL; pass an async factory as apiKey to fetch a fresh token on each connection. In proxy mode the token is omitted and the proxy appends it server-side.

Example

// Direct connection (API key exposed to browser -- development only)
const config: RevAISTTConfig = {
  apiKey: '02.abc123...',
  sampleRate: 16000,
};

// Proxy connection (recommended for production)
const config: RevAISTTConfig = {
  proxyUrl: 'http://localhost:3001/api/proxy/revai',
  language: 'en',
};

See

RevAISTT for the provider class

Extends

Properties

PropertyTypeDefault valueDescriptionInherited fromDefined in
apiKey?string | () => Promise<string>undefinedAPI key or authentication token for the provider. Remarks Can be a static string or an async factory function that returns a fresh token on each call. Use a factory for short-lived tokens (e.g. Deepgram JWTs) so each WebSocket connection gets a valid credential. For client-side usage, consider using a proxy server to keep API keys secure. The SDK provides Express, Next.js, and Node adapters for this purpose.STTProviderConfig.apiKeysrc/core/types/providers.ts:71
audioFormat?stringundefinedRaw audio sample format as a case-sensitive GStreamer format string (e.g. 'S16LE', 'F32LE'). Default 'S16LE'-src/providers/stt/revai/RevAISTT.ts:81
authType?"token" | "bearer"Provider-specific (typically 'token' for Deepgram, ignored for REST providers)Authentication type for providers that support multiple auth mechanisms. Remarks Controls how the apiKey is sent to the provider: - 'token' — WebSocket subprotocol ['token', apiKey] or header Authorization: Token <key>. This is the default for Deepgram providers. - 'bearer' — WebSocket subprotocol ['bearer', token] or header Authorization: Bearer <token>. Use this for OAuth tokens or providers that expect Bearer auth. REST/SDK providers (Anthropic, OpenAI) handle auth through their SDK constructors and ignore this field.STTProviderConfig.authTypesrc/core/types/providers.ts:115
contentType?stringundefinedFull content_type string describing the streamed audio, overriding the value built from layout, sampleRate, audioFormat, and numChannels. Remarks Rev AI supports audio/x-raw (with layout/rate/format/channels parameters), audio/x-flac, and audio/x-wav. Example 'audio/x-flac' Default built from the raw audio options, e.g. 'audio/x-raw;layout=interleaved;rate=16000;format=S16LE;channels=1'-src/providers/stt/revai/RevAISTT.ts:65
customVocabularyId?stringundefinedCustom vocabulary identifier for domain-specific terms. Remarks Cannot be combined with a non-English language.-src/providers/stt/revai/RevAISTT.ts:97
debug?booleanfalseWhether to enable debug logging for this provider. Remarks When true, the provider emits detailed internal logs. This is separate from the SDK-level LoggingConfig.STTProviderConfig.debugsrc/core/types/providers.ts:126
deleteAfterSeconds?numberundefinedSeconds (0-2592000) after which Rev AI deletes the job and its transcript automatically.-src/providers/stt/revai/RevAISTT.ts:143
detailedPartials?booleanundefinedInclude per-element timestamps and confidence scores in partial hypotheses (finals always include them). Remarks Enabling this slightly degrades accuracy (about 1% WER). Default false-src/providers/stt/revai/RevAISTT.ts:125
enableSpeakerSwitch?booleanundefinedAdd a speaker_id field to final hypothesis elements when the speaker changes. Remarks Requires the machine_v2 transcriber. Default false-src/providers/stt/revai/RevAISTT.ts:158
endpoint?stringundefinedCustom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments.STTProviderConfig.endpointsrc/core/types/providers.ts:79
filterProfanity?booleanundefinedReplace recognized profanities with asterisks. Remarks English only — cannot be combined with a non-English language. Default false-src/providers/stt/revai/RevAISTT.ts:106
interimResults?booleanundefinedWhether to enable interim (partial) transcription results. Remarks When true, the provider emits results as the user speaks, before the utterance is complete. Only applicable to live/WebSocket providers.STTProviderConfig.interimResultssrc/core/types/providers.ts:392
keywords?string[]undefinedCustom vocabulary or keyword phrases to boost recognition accuracy. Remarks Useful for domain-specific terminology, product names, or proper nouns that the model might not recognize well by default.STTProviderConfig.keywordssrc/core/types/providers.ts:406
language?stringundefinedLanguage code for transcription. Remarks Uses BCP 47 language tags (e.g., 'en-US', 'es-ES', 'fr-FR'). The supported languages depend on the provider and model.STTProviderConfig.languagesrc/core/types/providers.ts:375
layout?"interleaved" | "non-interleaved"undefinedChannel layout for raw audio (audio/x-raw only). Default 'interleaved'-src/providers/stt/revai/RevAISTT.ts:70
maxConnectionWaitSeconds?numberundefinedSeconds (60-600) to wait for an available Rev AI worker before the connection is closed with code 4013. Default 60 (Rev AI server default)-src/providers/stt/revai/RevAISTT.ts:184
maxSegmentDurationSeconds?numberundefinedMaximum duration in seconds (5-30) of a transcription segment before Rev AI forces a final hypothesis. Remarks Lower values produce final results sooner at a small accuracy cost. The actual segment may extend up to 0.5 s beyond this value.-src/providers/stt/revai/RevAISTT.ts:138
metadata?stringundefinedMetadata string attached to the streaming job for request tracking.-src/providers/stt/revai/RevAISTT.ts:90
model?stringundefinedModel to use for transcription. Remarks Provider-specific model identifier (e.g., 'nova-3' for Deepgram).STTProviderConfig.modelsrc/core/types/providers.ts:383
numChannels?numberundefinedNumber of audio channels for raw audio (1-10). Default 1-src/providers/stt/revai/RevAISTT.ts:86
priority?"speed" | "accuracy"undefinedTrade-off between result frequency and accuracy. Remarks 'speed' emits results more frequently; 'accuracy' emits fewer, more accurate results. English and Spanish with machine_v2 only. Default 'speed' (Rev AI server default)-src/providers/stt/revai/RevAISTT.ts:178
proxyUrl?stringundefinedURL of a CompositeVoice proxy server endpoint for this provider. Remarks When set, requests are routed through the proxy which injects the real API key server-side. This keeps API keys out of the browser. For WebSocket providers the HTTP URL is automatically converted to ws(s)://. At least one of apiKey or proxyUrl must be set for providers that require authentication (all except NativeSTT, NativeTTS, and WebLLM). Example proxyUrl: 'http://localhost:3000/api/proxy/deepgram'STTProviderConfig.proxyUrlsrc/core/types/providers.ts:97
punctuation?booleanundefinedWhether to enable automatic punctuation in transcription results.STTProviderConfig.punctuationsrc/core/types/providers.ts:397
removeDisfluencies?booleanundefinedRemove filler words (“ums” and “uhs”) from the transcription. Remarks English only — cannot be combined with a non-English language. Default false-src/providers/stt/revai/RevAISTT.ts:115
sampleRate?numberundefinedAudio sample rate in Hz for raw audio (8000-48000). Default 16000-src/providers/stt/revai/RevAISTT.ts:75
skipPostprocessing?booleanundefinedDisable capitalization, punctuation, and inverse text normalization to reduce latency. Remarks English and Spanish only. Default false-src/providers/stt/revai/RevAISTT.ts:168
startTs?numberundefinedPositive offset in seconds added to all hypothesis timestamps.-src/providers/stt/revai/RevAISTT.ts:129
timeout?numberundefinedRequest timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout.STTProviderConfig.timeoutsrc/core/types/providers.ts:135
transcriber?stringundefinedTranscription model to use (e.g. 'machine_v2'). Default Rev AI's default streaming model-src/providers/stt/revai/RevAISTT.ts:148

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency