Interface OpenAITextToSpeechProviderConfig

Configuration for the OpenAITextToSpeechProvider.

interface OpenAITextToSpeechProviderConfig {
    apiKey: string;
    baseUrl?: string;
    model?: string;
    voice?: string;
    fetchImpl?: {
        (input, init?): Promise<Response>;
        (input, init?): Promise<Response>;
    };
}

Properties

apiKey: string

OpenAI API key used for authentication. Sent as Authorization: Bearer <apiKey>.

baseUrl?: string

Base URL for the OpenAI API. Override for proxies, Azure OpenAI, or compatible third-party endpoints.

Default

'https://api.openai.com/v1'
model?: string

Default TTS model. tts-1 is optimized for real-time, tts-1-hd for quality.

Default

'tts-1'
voice?: string

Default voice identifier. See OPENAI_VOICES for available options.

Default

'nova'
fetchImpl?: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Custom fetch implementation for dependency injection in tests.

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: string | Request | URL
      • Optional init: RequestInit

      Returns Promise<Response>

Default

globalThis.fetch