MiniMax

Updated

Integrate MiniMax TTS with the Conversational AI Engine.

MiniMax provides text-to-speech (TTS) with multiple voice styles and low-latency streaming output.

Sample configuration

The following examples show how to configure MiniMax TTS when starting a conversational AI agent.

from agora_agent import Agent
from agora_agent.agentkit.vendors import MiniMaxTTS

# client is your configured Agora client
agent = (
    Agent(client)
    .with_stt(...)  # configure your STT vendor
    .with_llm(...)  # configure your LLM vendor
    .with_tts(MiniMaxTTS(
        key='your-minimax-key',  # omit key, group_id, voice_id, and url to use Agora-managed mode
        group_id='your-minimax-group-id',
        model='speech-2.8-turbo',
        voice_id='English_captivating_female1',
        url='wss://api-uw.minimax.io/ws/v1/t2a_v2',
    ))
)
import { Agent, MiniMaxTTS } from 'agora-agents';

// client is your configured Agora client
const agent = new Agent({ client })
  .withStt(/* configure your STT vendor */)
  .withLlm(/* configure your LLM vendor */)
  .withTts(new MiniMaxTTS({
    key: 'your-minimax-key',  // omit key, groupId, voiceId, and url to use Agora-managed mode
    groupId: 'your-minimax-group-id',
    model: 'speech-2.8-turbo',
    voiceId: 'English_captivating_female1',
    url: 'wss://api-uw.minimax.io/ws/v1/t2a_v2',
  }));
import "github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"

// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
  WithLlm(/* configure your LLM vendor */).
  WithTts(
    vendors.NewMiniMaxTTS(vendors.MiniMaxTTSOptions{
        Key:     "your-minimax-key", // omit Key, GroupID, VoiceID, and URL to use Agora-managed mode
        GroupID: "your-minimax-group-id",
        Model:   "speech-2.8-turbo",
        VoiceID: "English_captivating_female1",
        URL:     "wss://api-uw.minimax.io/ws/v1/t2a_v2",
    }),
)
  • Managed mode

    To use MiniMax TTS with Agora-managed credentials, set credential_mode to "managed" in the tts block. When using managed mode, params.key and params.group_id are not required. You can still use the tts field to configure additional settings such as voice_setting. For more information, see Use managed mode.

    "tts": {
      "credential_mode": "managed",
      "vendor": "minimax",
      "params": {
        "url": "wss://api.minimax.io/ws/v1/t2a_v2",
        "model": "speech-2.8-turbo",
        "voice_setting": {
          "voice_id": "English_captivating_female1",
          "speed": 1.0
        },
        "audio_setting": {
          "sample_rate": 44100
        }
      }
    }
  • BYOK

    "tts": {
      "vendor": "minimax",
      "params": {
        "key": "<minimax_key>",
        "group_id": "<minimax_group_id>",
        "model": "speech-2.8-turbo",
        "url": "wss://api-uw.minimax.io/ws/v1/t2a_v2",
        "voice_setting": {
          "voice_id": "English_captivating_female1",
          "speed": 1.0
        },
        "audio_setting": {
          "sample_rate": 44100
        }
      }
    }

Caution

The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For a full list of supported options, refer to the MiniMax documentation.

Key parameters

The following parameters are required when using your own API key (BYOK). When using managed mode, key and group_id are not required. For more information, see Use managed mode.

params
keystring
optional

The MiniMax API key used to authenticate requests. Required when using your own API key (BYOK).

group_idstring
optional

The MiniMax group identifier. Required when using your own API key (BYOK).

urlstring
required

The WebSocket endpoint for streaming TTS output. For example, wss://api-uw.minimax.io/ws/v1/t2a_v2.

modelstring
required

The TTS model to use. For example, speech-02-turbo.

voice_setting.voice_idstring
required

The voice style identifier to use. For example, English_captivating_female1.

audio_setting.sample_ratenumber
required

The audio sampling rate in Hz.