Skip to content

GladiaSTTConfig

Configuration options for the GladiaSTT provider.

Defined in: src/providers/stt/gladia/GladiaSTT.ts:66

Configuration options for the GladiaSTT provider.

Remarks

Extends STTProviderConfig with Gladia-specific settings. You must provide either apiKey (for direct browser-to-Gladia session initiation) or proxyUrl (for a server-side proxy that injects the x-gladia-key header). If both are provided, proxyUrl takes precedence.

Authentication only happens on the HTTP session-init request. The WebSocket URL returned by Gladia embeds a single-use session token, so the audio stream always connects directly to Gladia — even in proxy mode.

Example

// Direct connection (development)
const config: GladiaSTTConfig = {
  apiKey: 'YOUR_GLADIA_API_KEY',
  sampleRate: 16000,
  languages: ['en'],
};

// Proxy connection (recommended for production)
const config: GladiaSTTConfig = {
  proxyUrl: 'http://localhost:3001/api/proxy/gladia',
  endpointing: 0.3,
};

See

GladiaSTT for the provider class

Extends

Properties

PropertyTypeDefault valueDescriptionOverridesInherited 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
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
bitDepth?numberundefinedBit depth of the audio stream. Gladia accepts 8, 16, 24, or 32. Default 16--src/providers/stt/gladia/GladiaSTT.ts:87
channels?numberundefinedNumber of audio channels (1-8). Default 1--src/providers/stt/gladia/GladiaSTT.ts:92
codeSwitching?booleanundefinedRe-detect the language for every utterance instead of once per session. Useful for conversations that switch languages mid-stream. Default false--src/providers/stt/gladia/GladiaSTT.ts:134
customMetadata?Record<string, unknown>undefinedArbitrary metadata attached to the session (custom_metadata), visible in Gladia’s session results.--src/providers/stt/gladia/GladiaSTT.ts:161
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
encoding?GladiaSTTEncodingundefinedEncoding of the streamed audio. Default 'wav/pcm'--src/providers/stt/gladia/GladiaSTT.ts:76
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
endpointing?numberundefinedSilence duration in seconds before Gladia ends an utterance and emits a final transcript. Accepted range is 0.01 to 10. Remarks Endpointing drives turn-taking in the CompositeVoice pipeline: every final transcript is emitted with utteranceComplete: true. The Gladia default (0.05 s) is aggressive for conversational agents — values around 0.3-0.8 s give more natural turns. Default 0.05 (Gladia server default)--src/providers/stt/gladia/GladiaSTT.ts:112
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
languages?string[]undefinedLanguages spoken in the audio, as ISO 639-1 codes (e.g. ['en', 'es']). Remarks When omitted, falls back to [language] if the base language option is set; otherwise Gladia auto-detects the language. A single entry pins the language; multiple entries restrict detection to that set.--src/providers/stt/gladia/GladiaSTT.ts:128
maximumDurationWithoutEndpointing?numberundefinedMaximum utterance duration in seconds before Gladia forces an endpoint even while speech continues. Accepted range is 5 to 60. Default 5 (Gladia server default)--src/providers/stt/gladia/GladiaSTT.ts:118
maxRetries?numberundefinedMaximum number of retries for the session-init HTTP request. Default 3--src/providers/stt/gladia/GladiaSTT.ts:166
messagesConfig?Record<string, unknown>undefinedExtra messages_config flags merged on top of the provider defaults (receive_partial_transcripts from interimResults, receive_final_transcripts: true).--src/providers/stt/gladia/GladiaSTT.ts:156
model?stringundefinedThe Gladia live transcription model to use. Default 'solaria-1'STTProviderConfig.model-src/providers/stt/gladia/GladiaSTT.ts:71
preProcessing?Record<string, unknown>undefinedGladia pre_processing options (e.g. audio_enhancer, speech_threshold), passed through verbatim. Remarks See the Gladia session-init reference for the full structure.--src/providers/stt/gladia/GladiaSTT.ts:142
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
realtimeProcessing?Record<string, unknown>undefinedGladia realtime_processing options (custom vocabulary, translation, named entity recognition, sentiment analysis), passed through verbatim. Remarks See the Gladia session-init reference for the full structure.--src/providers/stt/gladia/GladiaSTT.ts:150
region?GladiaSTTRegionundefinedProcessing region for the session (region query parameter on the session-init request). Default undefined (Gladia default region)--src/providers/stt/gladia/GladiaSTT.ts:99
sampleRate?numberundefinedAudio sample rate in Hz. Gladia accepts 8000, 16000, 32000, 44100, or 48000. Default 16000--src/providers/stt/gladia/GladiaSTT.ts:82
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

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency