# MiniMax (/en/ai/models/tts/minimax)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

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

### Sample configuration [#sample-configuration]

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

<Tabs defaultValue="python" groupId="ai-sdk-language">
  <TabsList>
    <TabsTrigger value="python">
      Python SDK
    </TabsTrigger>

    <TabsTrigger value="typescript">
      TypeScript SDK
    </TabsTrigger>

    <TabsTrigger value="go">
      Go SDK
    </TabsTrigger>

    <TabsTrigger value="rest-api">
      REST API
    </TabsTrigger>
  </TabsList>

  <TabsContent value="python">
    ```python
    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',
        ))
    )
    ```
  </TabsContent>

  <TabsContent value="typescript">
    ```typescript
    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',
      }));
    ```
  </TabsContent>

  <TabsContent value="go">
    ```go
    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",
        }),
    )
    ```
  </TabsContent>

  <TabsContent value="rest-api">
    * **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](/en/ai/build/custom-model-integration/managed-mode).

      ```json
      "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**

      ```json
      "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
          }
        }
      }
      ```
  </TabsContent>
</Tabs>

<CalloutContainer type="warning">
  <CalloutTitle>
    Caution
  </CalloutTitle>

  <CalloutDescription>
    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](https://www.minimax.io/platform/document/t2a_http).
  </CalloutDescription>
</CalloutContainer>

### Key parameters [#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](/en/ai/build/custom-model-integration/managed-mode).

<ParameterList title="params">
  <Parameter name="key" type="string" required="false">
    The MiniMax API key used to authenticate requests. Required when using your own API key (BYOK).
  </Parameter>

  <Parameter name="group_id" type="string" required="false">
    The MiniMax group identifier. Required when using your own API key (BYOK).
  </Parameter>

  <Parameter name="url" type="string" required="true">
    The WebSocket endpoint for streaming TTS output. For example, `wss://api-uw.minimax.io/ws/v1/t2a_v2`.
  </Parameter>

  <Parameter name="model" type="string" required="true">
    The TTS model to use. For example, `speech-02-turbo`.
  </Parameter>

  <Parameter name="voice_setting.voice_id" type="string" required="true">
    The voice style identifier to use. For example, `English_captivating_female1`.
  </Parameter>

  <Parameter name="audio_setting.sample_rate" type="number" required="true">
    The audio sampling rate in Hz.
  </Parameter>
</ParameterList>
