# What TTS Providers Are Available for OpenMAIC: Complete List and Setup Guide

> Explore OpenMAIC's TTS providers: OpenAI, Azure Speech, ElevenLabs, and more. Get a complete list and easy setup guide to integrate text-to-speech for your project.

- Repository: [MAIC/OpenMAIC](https://github.com/THU-MAIC/OpenMAIC)
- Tags: tutorial
- Published: 2026-09-12

---

**OpenMAIC supports 10 TTS providers including OpenAI, Azure Speech, ElevenLabs, and a browser-native Web Speech API option, all routed through the `generateTTS()` factory function based on the `providerId` field in `TTSModelConfig`.**

OpenMAIC implements a pluggable Text-to-Speech (TTS) framework that dynamically routes synthesis requests to cloud services or client-side engines. The system selects the appropriate implementation at runtime using a switch-based factory pattern defined in [`lib/audio/tts-providers.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/tts-providers.ts), allowing seamless switching between commercial APIs and local processing.

## Complete List of OpenMAIC TTS Providers

The provider registry is enumerated in the header comments of [`lib/audio/tts-providers.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/tts-providers.ts) (lines 7-15), with individual implementations handled in a switch statement beginning at line 44. OpenMAIC currently integrates the following TTS providers:

- **openai-tts**: OpenAI TTS API supporting voices like `alloy` and models including `gpt-4o-mini-tts` (implemented at lines 44-46).
- **azure-tts**: Microsoft Azure Speech Service for enterprise-grade synthesis (lines 47-49).
- **glm-tts**: Alibaba GLM TTS provider optimized for Chinese and multilingual generation (lines 50-52).
- **qwen-tts**: DashScope Qwen TTS service tailored for conversational AI applications (lines 53-55).
- **voxcpm-tts**: VoxCPM TTS with support for both internal and external backends (lines 56-58).
- **minimax-tts**: MiniMax TTS API integration (lines 59-61).
- **doubao-tts**: Volcengine Doubao (ByteDance) speech synthesis service (lines 62-64).
- **elevenlabs-tts**: ElevenLabs high-fidelity voice cloning and generation platform (lines 64-66).
- **lemonade-tts**: OpenAI-compatible endpoint provider for custom TTS deployments (lines 66-68).
- **browser-native-tts**: Client-side Web Speech API implementation requiring no external credentials (lines 69-71).

## How to Configure and Use TTS Providers

To generate speech, import the `generateTTS` function from [`lib/audio/tts-providers.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/tts-providers.ts). This factory accepts a `TTSModelConfig` object and returns a `Promise<TTSGenerationResult>` containing raw audio bytes.

### Explicit Provider Configuration

Define the `providerId` and credentials directly in the configuration object:

```typescript
import { generateTTS } from '@/lib/audio/tts-providers';

const openaiConfig = {
  providerId: 'openai-tts',
  apiKey: 'YOUR_OPENAI_API_KEY',
  voice: 'alloy',
  modelId: 'gpt-4o-mini-tts',
  speed: 1.0,
};

const result = await generateTTS(openaiConfig, 'Hello, OpenMAIC!');
console.log('Audio bytes length:', result.audio.length, 'Format:', result.format);

```

### Using Stored UI Configuration

For applications utilizing the built-in settings store, retrieve the active configuration with `getCurrentTTSConfig()`:

```typescript
import { generateTTS, getCurrentTTSConfig } from '@/lib/audio/tts-providers';

const cfg = await getCurrentTTSConfig(); // Pulls provider/voice/speed from settings
const result = await generateTTS(cfg, '欢迎使用 OpenMAIC');

// Result conforms to TTSGenerationResult interface
// { audio: Uint8Array, format: string }

```

## Key Implementation Files

The TTS ecosystem is organized across these source files in the THU-MAIC/OpenMAIC repository:

- **[`lib/audio/tts-providers.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/tts-providers.ts)**: Central factory defining `generateTTS()` and the provider switch logic (lines 44-71). Imports metadata from [`constants.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/constants.ts).
- **[`lib/audio/constants.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/constants.ts)**: Exports `TTS_PROVIDERS` constant containing default URLs, required API-key flags, and available voice lists for each provider.
- **[`lib/audio/types.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/types.ts)**: TypeScript definitions including `TTSModelConfig`, `TTSGenerationResult`, and provider type guards.
- **[`components/settings/tts-settings.tsx`](https://github.com/THU-MAIC/OpenMAIC/blob/main/components/settings/tts-settings.tsx)**: React component for provider selection, API key entry, and voice/speed configuration.
- **[`hooks/use-discussion-tts.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/hooks/use-discussion-tts.ts)**: Runtime hook integrating TTS generation into agent discussions.

## Summary

- OpenMAIC provides **10 built-in TTS providers** ranging from cloud APIs (OpenAI, Azure, ElevenLabs) to client-side synthesis (browser-native Web Speech API).
- Provider selection is controlled by the **`providerId`** field in `TTSModelConfig`, processed by the `generateTTS()` factory in [`lib/audio/tts-providers.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/tts-providers.ts).
- The framework returns standardized **`TTSGenerationResult`** objects containing `Uint8Array` audio data and format strings like `'mp3'` or `'wav'`.
- Configuration can be passed explicitly or retrieved from the UI settings store via **`getCurrentTTSConfig()`**.
- Only the **`browser-native-tts`** provider operates without external API credentials.

## Frequently Asked Questions

### How do I switch between TTS providers in OpenMAIC?

Change the `providerId` value in your `TTSModelConfig` object before calling `generateTTS()`. Valid values include `'openai-tts'`, `'elevenlabs-tts'`, and `'browser-native-tts'`. The factory function automatically routes to the correct implementation based on this identifier as defined in the switch statement at [`lib/audio/tts-providers.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/tts-providers.ts).

### Which OpenMAIC TTS provider does not require an API key?

The **`browser-native-tts`** provider uses the browser's built-in Web Speech API and requires no external authentication. All other providers—including OpenAI, Azure, and ElevenLabs—require valid API keys configured in the `apiKey` field of the configuration object.

### What audio format does OpenMAIC return from TTS generation?

According to the `TTSGenerationResult` interface defined in [`lib/audio/types.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/lib/audio/types.ts), the `generateTTS()` function returns an object with `audio: Uint8Array` containing raw audio bytes and `format: string` indicating the codec. Typical formats include `'mp3'`, `'wav'`, or `'ogg'` depending on the specific provider's output configuration.

### Can I use custom TTS endpoints with OpenMAIC?

Yes, the **`lemonade-tts`** provider supports OpenAI-compatible API endpoints, allowing integration with custom TTS deployments or proxy services. Configure it by setting `providerId: 'lemonade-tts'` and providing the custom base URL and API key in the configuration object passed to `generateTTS()`.