Skip to content

TTSProviderConfig

Configuration for text-to-speech providers.

Defined in: src/core/types/providers.ts:1047

Configuration for text-to-speech providers.

Remarks

Extends BaseProviderConfig with TTS-specific options for voice selection, model, speech rate, pitch, and output audio format.

Example

const ttsConfig: TTSProviderConfig = {
  apiKey: 'your-api-key',
  voice: 'aura-asteria-en',
  model: 'aura-2',
  rate: 1.0,
  outputFormat: 'pcm',
  sampleRate: 24000,
};

See

  • BaseProviderConfig for inherited fields
  • RestTTSProvider for REST-based TTS providers
  • LiveTTSProvider for WebSocket-based TTS providers

Extends

Extended by

Properties

PropertyTypeDefault valueDescriptionInherited fromDefined in
apiKey?stringundefinedAPI key or authentication token for the provider. Remarks 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.BaseProviderConfig.apiKeysrc/core/types/providers.ts:67
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.BaseProviderConfig.authTypesrc/core/types/providers.ts:111
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.BaseProviderConfig.debugsrc/core/types/providers.ts:122
endpoint?stringundefinedCustom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments.BaseProviderConfig.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).-src/core/types/providers.ts:1063
outputFormat?stringundefinedOutput audio format identifier. Remarks Provider-specific format string (e.g., 'linear16', 'mp3', 'opus').-src/core/types/providers.ts:1088
pitch?numberundefinedPitch adjustment in semitones. Remarks Values from -20 to +20 semitones. Not all providers support pitch adjustment.-src/core/types/providers.ts:1080
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'BaseProviderConfig.proxyUrlsrc/core/types/providers.ts:93
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.-src/core/types/providers.ts:1072
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.-src/core/types/providers.ts:1097
timeout?numberundefinedRequest timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout.BaseProviderConfig.timeoutsrc/core/types/providers.ts:131
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.-src/core/types/providers.ts:1055

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency