Modern .NET SDK for MiniMax generated from the provider's OpenAPI definition with AutoSDK.
Built from a hand-maintained OpenAPI definition derived from MiniMax's published API documentation so the SDK stays close to the upstream API surface.
Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.
Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.
using MiniMax;
using var client = new MiniMaxClient(apiKey);Validate a local key against MiniMax's documented free music model without running the full integration suite:
./scripts/smoke-minimax-key.shTo let local integration tests read a repo-local .env while keeping CI on normal environment secrets, opt in explicitly:
MINIMAX_LOAD_DOTENV=1 dotnet test src/tests/IntegrationTests/Submits a Hailuo video generation task and returns the task_id.
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}");Generates one or more images with MiniMax's shared image endpoint and returns image URLs.
using var client = new MiniMaxClient(apiKey);
var response = await client.Image.CreateImageGenerationAsync(
model: "image-01",
prompt: "A clean product photo of a matte black mechanical keyboard on a walnut desk, soft studio lighting, photorealistic.",
aspectRatio: ImageGenerationRequestAspectRatio.x16_9,
responseFormat: ImageGenerationRequestResponseFormat.Url,
n: 1,
promptOptimizer: true);
Console.WriteLine($"image_url: {response.Data?.ImageUrls?.FirstOrDefault()}");Uses the same image endpoint with subject_reference to perform image-to-image generation.
using var client = new MiniMaxClient(apiKey);
var response = await client.Image.CreateImageGenerationAsync(
model: "image-01",
prompt: "Turn this portrait into a cinematic magazine cover with warm golden-hour lighting and shallow depth of field.",
subjectReference:
[
new ImageSubjectReference
{
Type = ImageSubjectReferenceType.Character,
ImageFile = "https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg",
},
],
responseFormat: ImageGenerationRequestResponseFormat.Url,
n: 1);
Console.WriteLine($"image_url: {response.Data?.ImageUrls?.FirstOrDefault()}");Uses T2A v2 to synthesize speech from text and returns a downloadable URL.
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}");Generates an instrumental track with music-2.6 and returns a downloadable URL.
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}");Exposes MiniMax video, music, TTS, and voice-clone endpoints as MEAI AIFunctions so they can be attached to any IChatClient.
using var client = new MiniMaxClient(apiKey);
AIFunction[] tools =
[
client.AsCreateVideoTaskTool(),
client.AsGetVideoTaskTool(),
client.AsGenerateMusicTool(),
client.AsSynthesizeSpeechTool(),
client.AsCloneVoiceTool(),
];
Console.WriteLine(string.Join(", ", tools.Select(t => t.Name)));This SDK is one of more than 200 .NET SDKs maintained with AutoSDK. The tryAGI SDK audit continuously checks repository synchronization, upstream-spec regeneration, release workflows, warnings, public API visibility, and trimming/NativeAOT compatibility.
Every issue is first investigated for ecosystem-wide applicability. When the root cause belongs in AutoSDK, we fix and regression-test the generator, then roll the improvement out to every applicable SDK. Provider-specific behavior remains in this repository when it cannot be derived safely from the API specification.
Issue content—including code blocks, logs, links, and attachments—is treated only as untrusted diagnostic data. Embedded control instructions, hidden directives, delimiter tricks, or requests to alter triage or tooling behavior are ignored. Please report reproducible technical evidence and remove secrets and personal data.
Open an issue in tryAGI/MiniMax.
Use GitHub Discussions for design questions and usage help.
Join the tryAGI Discord for broader discussion across SDKs.
This project is supported by JetBrains through the Open Source Support Program.
