Skip to content

ElevenLabsTTSConfig

Configuration for the ElevenLabsTTS provider.

Defined in: src/providers/tts/elevenlabs/ElevenLabsTTS.ts:97

Configuration for the ElevenLabsTTS provider.

Remarks

Provide either apiKey (for direct API access) or proxyUrl (for server-side proxy). At least one must be set. If both are provided, proxyUrl takes precedence and the API key is not sent to the client. The voiceId is always required.

Example

// Direct API access
const config: ElevenLabsTTSConfig = {
  apiKey: 'el-xxxxxxxxxxxx',
  voiceId: '21m00Tcm4TlvDq8ikWAM',
  modelId: 'eleven_turbo_v2_5',
  stability: 0.5,
  similarityBoost: 0.75,
  outputFormat: 'pcm_24000',
};

// Via proxy server
const proxyConfig: ElevenLabsTTSConfig = {
  proxyUrl: 'http://localhost:3001/api/proxy/elevenlabs',
  voiceId: '21m00Tcm4TlvDq8ikWAM',
};

See

Extends

Properties

PropertyTypeDefault valueDescriptionOverridesInherited fromDefined in
apiKey?stringundefinedElevenLabs API key for direct authentication. Remarks Required when connecting directly to ElevenLabs (no proxy). Omit when using proxyUrl — the proxy server supplies the key server-side.TTSProviderConfig.apiKey-src/providers/tts/elevenlabs/ElevenLabsTTS.ts:105
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.-TTSProviderConfig.debugsrc/core/types/providers.ts:86
endpoint?stringundefinedCustom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments.-TTSProviderConfig.endpointsrc/core/types/providers.ts:75
model?stringundefinedModel to use for text-to-speech synthesis. Remarks Provider-specific model identifier (e.g., 'aura-2' for Deepgram).-TTSProviderConfig.modelsrc/core/types/providers.ts:975
modelId?ElevenLabsTTSModel'eleven_turbo_v2_5'Model ID to use for synthesis. See ElevenLabsTTSModel--src/providers/tts/elevenlabs/ElevenLabsTTS.ts:134
outputFormat?ElevenLabsOutputFormat'pcm_16000'Output audio format string that encodes both encoding and sample rate. See ElevenLabsOutputFormatTTSProviderConfig.outputFormat-src/providers/tts/elevenlabs/ElevenLabsTTS.ts:164
pitch?numberundefinedPitch adjustment in semitones. Remarks Values from -20 to +20 semitones. Not all providers support pitch adjustment.-TTSProviderConfig.pitchsrc/core/types/providers.ts:992
proxyUrl?stringundefinedURL of the CompositeVoice proxy server’s ElevenLabs endpoint. Remarks When set, the WebSocket connection is routed through the proxy and the apiKey is not required on the client side. The HTTP URL is automatically converted to a WebSocket URL (ws:// or wss://). Example 'http://localhost:3001/api/proxy/elevenlabs'--src/providers/tts/elevenlabs/ElevenLabsTTS.ts:117
rate?numberundefinedSpeech rate multiplier. Remarks Values from 0.25 (quarter speed) to 4.0 (quadruple speed), where 1.0 is normal speed. Not all providers support rate adjustment.-TTSProviderConfig.ratesrc/core/types/providers.ts:984
sampleRate?numberundefinedSample rate for the output audio in Hz. Remarks Common values are 16000, 24000, and 48000. Must match the format capabilities of the chosen voice and model.-TTSProviderConfig.sampleRatesrc/core/types/providers.ts:1009
similarityBoost?number0.75Similarity boost (0 to 1). Remarks Higher values make the synthesized voice more closely match the original voice sample. Lower values allow more creative variation.--src/providers/tts/elevenlabs/ElevenLabsTTS.ts:156
stability?number0.5Voice stability (0 to 1). Remarks Higher values produce more consistent, predictable output. Lower values introduce more variation and expressiveness.--src/providers/tts/elevenlabs/ElevenLabsTTS.ts:145
timeout?numberundefinedRequest timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout.-TTSProviderConfig.timeoutsrc/core/types/providers.ts:95
voice?stringundefinedVoice ID or name to use for synthesis. Remarks Provider-specific voice identifier. For example, Deepgram uses identifiers like 'aura-asteria-en', while ElevenLabs uses voice IDs.-TTSProviderConfig.voicesrc/core/types/providers.ts:967
voiceIdstringundefinedElevenLabs voice ID (required). Remarks Find voice IDs via the ElevenLabs Voice Library or the API’s list voices endpoint.--src/providers/tts/elevenlabs/ElevenLabsTTS.ts:126

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency