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
| Property | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
apiKey? | string | () => Promise<string> | undefined | API 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.apiKey | src/core/types/providers.ts:71 |
audioFormat? | string | undefined | Raw 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.authType | src/core/types/providers.ts:115 |
contentType? | string | undefined | Full 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? | string | undefined | Custom vocabulary identifier for domain-specific terms. Remarks Cannot be combined with a non-English language. | - | src/providers/stt/revai/RevAISTT.ts:97 |
debug? | boolean | false | Whether 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.debug | src/core/types/providers.ts:126 |
deleteAfterSeconds? | number | undefined | Seconds (0-2592000) after which Rev AI deletes the job and its transcript automatically. | - | src/providers/stt/revai/RevAISTT.ts:143 |
detailedPartials? | boolean | undefined | Include 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? | boolean | undefined | Add 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? | string | undefined | Custom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments. | STTProviderConfig.endpoint | src/core/types/providers.ts:79 |
filterProfanity? | boolean | undefined | Replace 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? | boolean | undefined | Whether 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.interimResults | src/core/types/providers.ts:392 |
keywords? | string[] | undefined | Custom 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.keywords | src/core/types/providers.ts:406 |
language? | string | undefined | Language 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.language | src/core/types/providers.ts:375 |
layout? | "interleaved" | "non-interleaved" | undefined | Channel layout for raw audio (audio/x-raw only). Default 'interleaved' | - | src/providers/stt/revai/RevAISTT.ts:70 |
maxConnectionWaitSeconds? | number | undefined | Seconds (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? | number | undefined | Maximum 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? | string | undefined | Metadata string attached to the streaming job for request tracking. | - | src/providers/stt/revai/RevAISTT.ts:90 |
model? | string | undefined | Model to use for transcription. Remarks Provider-specific model identifier (e.g., 'nova-3' for Deepgram). | STTProviderConfig.model | src/core/types/providers.ts:383 |
numChannels? | number | undefined | Number of audio channels for raw audio (1-10). Default 1 | - | src/providers/stt/revai/RevAISTT.ts:86 |
priority? | "speed" | "accuracy" | undefined | Trade-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? | string | undefined | URL 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.proxyUrl | src/core/types/providers.ts:97 |
punctuation? | boolean | undefined | Whether to enable automatic punctuation in transcription results. | STTProviderConfig.punctuation | src/core/types/providers.ts:397 |
removeDisfluencies? | boolean | undefined | Remove 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? | number | undefined | Audio sample rate in Hz for raw audio (8000-48000). Default 16000 | - | src/providers/stt/revai/RevAISTT.ts:75 |
skipPostprocessing? | boolean | undefined | Disable capitalization, punctuation, and inverse text normalization to reduce latency. Remarks English and Spanish only. Default false | - | src/providers/stt/revai/RevAISTT.ts:168 |
startTs? | number | undefined | Positive offset in seconds added to all hypothesis timestamps. | - | src/providers/stt/revai/RevAISTT.ts:129 |
timeout? | number | undefined | Request timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout. | STTProviderConfig.timeout | src/core/types/providers.ts:135 |
transcriber? | string | undefined | Transcription model to use (e.g. 'machine_v2'). Default Rev AI's default streaming model | - | src/providers/stt/revai/RevAISTT.ts:148 |