← Back to PRs

#11463: feat(tts): add MiniMax as a core TTS provider

by AlexZhangji open 2026-02-07 21:01 View on GitHub →
docs channel: voice-call gateway
## Summary - Add **MiniMax TTS** as a fourth core provider alongside OpenAI, ElevenLabs, and Edge - MiniMax offers 300+ system voices across 40+ languages with HD and Turbo model variants - Configurable: model, voiceId, speed, vol, pitch, languageBoost, baseUrl - API key resolves from config or `MINIMAX_API_KEY` env var - Supports mp3 output (messages/Telegram) and pcm output (telephony/voice-call) - Auto-detection priority when no provider is configured: openai → elevenlabs → minimax → edge ## Changes **Core (5 files):** - `src/config/types.tts.ts` — added `"minimax"` to `TtsProvider` union, added minimax config to `TtsConfig` - `src/config/zod-schema.core.ts` — added `"minimax"` to `TtsProviderSchema`, added minimax Zod object - `src/tts/tts.ts` — added `minimaxTTS()` function, updated output format maps, `ResolvedTtsConfig`, `TtsDirectiveOverrides`, `resolveTtsConfig()`, `resolveTtsApiKey()`, `getTtsProvider()`, `TTS_PROVIDERS`, `parseTtsDirectives()`, `textToSpeech()`, `textToSpeechTelephony()` - `src/gateway/server-methods/tts.ts` — added minimax to provider validation, status, and provider list - `src/auto-reply/reply/commands-tts.ts` — added minimax to `/tts provider` command **Voice-call extension (3 files):** - `extensions/voice-call/src/config.ts` — added minimax to TTS schema - `extensions/voice-call/openclaw.plugin.json` — added minimax to JSON Schema - `extensions/voice-call/index.ts` — added minimax config labels **Docs + Tests (2 files):** - `docs/tts.md` — added minimax config example and field documentation - `src/tts/tts.test.ts` — added minimax config resolution tests, provider auto-detection test, directive parsing test ## Config example ```json5 { messages: { tts: { provider: "minimax", minimax: { apiKey: "your-key", // or MINIMAX_API_KEY env var model: "speech-2.8-hd", // default voiceId: "Friendly_Person", // default speed: 1.0, languageBoost: "auto", }, }, }, } ``` ## MiniMax TTS API details - Endpoint: `POST https://api.minimax.io/v1/t2a_v2` - Auth: Bearer token - Response: hex-encoded audio in `data.audio` - Models: `speech-2.8-hd` (best quality), `speech-2.8-turbo` (faster) - Formats: mp3, pcm, flac ## Test plan - [x] `pnpm build` passes (types compile) - [x] `pnpm check` passes (lint + format) - [x] `pnpm test` passes (958 files, 6499 tests, 0 failures) - [x] New minimax-specific tests: config resolution defaults, custom config values, provider auto-detection with MINIMAX_API_KEY, directive parsing with minimax_voice - [ ] Manual test with real MiniMax API key (tested locally, audio output works)

Most Similar PRs