Skip to content

MiniMax

Modern .NET SDK for MiniMax generated from the provider's OpenAPI definition with AutoSDK.

Nuget package dotnet License: MIT Discord

Generated from the source spec

Built from MiniMax's OpenAPI definition so the SDK stays close to the upstream API surface.

Auto-updated

Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.

Modern .NET

Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.

Docs from examples

Examples stay in sync between the README, MkDocs site, and integration tests through the AutoSDK docs pipeline.

Usage

1
2
3
using MiniMax;

using var client = new MiniMaxClient(apiKey);

Create a video generation task

Submits a Hailuo video generation task and returns the task_id.

1
2
3
4
5
6
7
8
9
using var client = new MiniMaxClient(apiKey);

var response = await client.Video.CreateVideoGenerationTaskAsync(
    model: "MiniMax-Hailuo-2.3",
    prompt: "A cinematic drone shot of a mountain range at sunrise, mist curling through the valleys.",
    duration: 6,
    resolution: VideoGenerationRequestResolution.x1080p);

Console.WriteLine($"task_id: {response.TaskId}");

Synthesize speech (T2A v2)

Uses T2A v2 to synthesize speech from text and returns a downloadable URL.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
using var client = new MiniMaxClient(apiKey);

var response = await client.Speech.CreateTextToSpeechAsync(
    model: "speech-2.6-turbo",
    text: "Hello from MiniMax T2A version 2. This is a test of the synthesis pipeline.",
    voiceSetting: new TtsVoiceSetting
    {
        VoiceId = "male-qn-qingse",
        Speed = 1.0f,
        Emotion = TtsVoiceSettingEmotion.Calm,
    },
    outputFormat: TextToSpeechRequestOutputFormat.Url);

Console.WriteLine($"audio: {response.Data?.Audio}");
Console.WriteLine($"length_ms: {response.ExtraInfo?.AudioLength}");

Generate music

Generates an instrumental track with music-2.6 and returns a downloadable URL.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
using var client = new MiniMaxClient(apiKey);

var response = await client.Music.CreateMusicGenerationAsync(
    model: "music-2.6",
    prompt: "Upbeat electronic track with driving drums and shimmering synths, 120 bpm, hopeful mood.",
    isInstrumental: true,
    outputFormat: MusicGenerationRequestOutputFormat.Url);

Console.WriteLine($"audio: {response.Data?.Audio}");
Console.WriteLine($"duration_ms: {response.ExtraInfo?.MusicDuration}");

MEAI AIFunction tools

Exposes MiniMax video, music, TTS, and voice-clone endpoints as MEAI AIFunctions so they can be attached to any IChatClient.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
using var client = new MiniMaxClient(apiKey);

AIFunction[] tools =
[
    client.AsCreateVideoTaskTool(),
    client.AsGetVideoTaskTool(),
    client.AsGenerateMusicTool(),
    client.AsSynthesizeSpeechTool(),
    client.AsCloneVoiceTool(),
];

    "CreateVideoTask",
    "GetVideoTask",
    "GenerateMusic",
    "SynthesizeSpeech",
    "CloneVoice");

Support

Bugs

Open an issue in tryAGI/MiniMax.

Ideas and questions

Use GitHub Discussions for design questions and usage help.

Community

Join the tryAGI Discord for broader discussion across SDKs.

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.