Interface MiniMaxTextToSpeechProviderConfig

interface MiniMaxTextToSpeechProviderConfig {
    apiKey: string;
    region?: MiniMaxSpeechRegion;
    model?: string;
    voice?: string;
    baseUrl?: string;
    webSocketUrl?: string;
    audioUrlHosts?: string[];
    audioDownloadTimeoutMs?: number;
    maxAudioDownloadBytes?: number;
    fetchImpl?: {
        (input, init?): Promise<Response>;
        (input, init?): Promise<Response>;
    };
    webSocketFactory?: ((url, headers) => WebSocket);
}

Properties

apiKey: string

The region whose API host requests go to: "global" (the default) sends to api.minimax.io, "china" to api.minimax.cn, the host MiniMax's China documentation names. baseUrl (the HTTP origin) and webSocketUrl (the whole WebSocket URL) override it, for example https://api.minimaxi.com and wss://api.minimaxi.com/ws/v1/t2a_v2 for the older China host.

model?: string
voice?: string
baseUrl?: string
webSocketUrl?: string
audioUrlHosts?: string[]

Hosts that outputFormat: "url" audio may be downloaded from: an exact name such as "audio.example.com", or "*.example.com" for that domain's subdomains. MiniMax does not document the host its audio links use, so none is allowed by default and URL output fails, naming the host, until it is listed here. Only https links are downloaded.

audioDownloadTimeoutMs?: number

Time allowed for downloading URL output, in milliseconds. Default: 30,000.

maxAudioDownloadBytes?: number

The largest URL output accepted, in bytes. Default: 100 MiB.

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

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>

webSocketFactory?: ((url, headers) => WebSocket)

Type declaration

    • (url, headers): WebSocket
    • Parameters

      • url: string
      • headers: Record<string, string>

      Returns WebSocket