Auto-generated C# SDK for the MiniMax Platform -- covers Hailuo video generation, music generation, text-to-speech (T2A v2), voice cloning, and file management.
Scope:
- Video -- Hailuo 2.3 / 2.3-Fast / 02 text-to-video, image-to-video, start-end, subject reference (async task pattern: POST + poll).
- Music --
music-2.6/music-cover/music-2.0generation. - Speech -- T2A v2 text-to-speech (
speech-2.8-hd,speech-2.8-turbo,speech-2.6-*,speech-02-*,speech-01-*) + voice clone. - Files -- upload/retrieve/list/delete (used as inputs for voice clone, music cover, video start frames).
Excluded (use another SDK):
- LLM chat completions -- use
tryAGI.OpenAI.CustomProviders.Minimax(...)for the OpenAI-compatible chat endpoint. - Embeddings -- MiniMax embeddings are chat-adjacent; use an LLM-focused SDK if needed.
- WebSocket TTS streaming -- not yet modelled; REST T2A v2
stream=truestill works.
No public OpenAPI spec exists -- openapi.yaml is handcrafted from platform.minimax.io/docs.
dotnet build MiniMax.slnx
dotnet test src/tests/IntegrationTests/Tests skip (AssertInconclusiveException) when MINIMAX_API_KEY is missing.
Standard Bearer token. Get an API key from https://platform.minimax.io/user-center/basic-information/interface-key.
using var client = new MiniMaxClient(apiKey); // MINIMAX_API_KEY env var- Default:
https://api.minimax.io(global) - China mainland:
https://api.minimaxi.chat
Switch via client.TrySelectServer("https-api-minimaxi-chat") or pass
baseUri to the constructor.
| Sub-client | Endpoints | Purpose |
|---|---|---|
client.Video |
POST /v1/video_generation, GET /v1/query/video_generation |
Hailuo video tasks |
client.Music |
POST /v1/music_generation |
Music generation |
client.Speech |
POST /v1/t2a_v2, POST /v1/voice_clone |
TTS + voice cloning |
client.Files |
POST/GET /v1/files/{upload,retrieve,list,delete} |
File management |
// 1. Submit
var create = await client.Video.CreateVideoGenerationTaskAsync(
model: "MiniMax-Hailuo-2.3",
prompt: "A drone shot of mountains at sunrise",
duration: 6,
resolution: VideoGenerationRequestResolution.x1080p);
// 2. Poll (Preparing -> Queueing -> Processing -> Success)
while (true)
{
var status = await client.Video.GetVideoGenerationTaskAsync(create.TaskId!);
if (status.Status is VideoTaskStatus.Success or VideoTaskStatus.Fail)
break;
await Task.Delay(TimeSpan.FromSeconds(10));
}
// 3. Retrieve file URL
var file = await client.Files.RetrieveFileAsync(status.FileId!);
// file.File.DownloadUrlAIFunction tools for use with any IChatClient (via MiniMaxToolExtensions):
AsCreateVideoTaskTool()-- submit a Hailuo video taskAsGetVideoTaskTool()-- poll a video task by IDAsGenerateMusicTool()-- generate music from prompt/lyricsAsSynthesizeSpeechTool()-- T2A v2 speech synthesisAsCloneVoiceTool()-- create a voice clone from an uploaded file
No dedicated IChatClient / IEmbeddingGenerator / ISpeechToTextClient
implementation -- T2A v2 does synthesis only, not transcription. Chat goes
through tryAGI.OpenAI.CustomProviders.Minimax(...).
src/libs/MiniMax/openapi.yaml-- Handcrafted OpenAPI specsrc/libs/MiniMax/generate.sh-- Regen script (runsautosdkon local spec)src/libs/MiniMax/Generated/-- Never edit -- auto-generated codesrc/libs/MiniMax/Extensions/MiniMaxClient.Tools.cs-- MEAIAIFunctiontoolssrc/tests/IntegrationTests/Examples/-- Example tests (also generate docs)
- Enum naming:
VideoGenerationRequestResolution.x1080p/x768p/x512p(AutoSDK prependsxwhen enum values start with digits). - Resolution per model: Hailuo-2.3 supports 512P/768P/1080P, Hailuo-2.3-Fast is 768P only, Hailuo-02 supports 768P/1080P -- check the platform docs for the exact matrix before each release.
- Audio output: default is
hex(inline hex-encoded bytes). PassoutputFormat: *OutputFormat.Urlfor a downloadable link. - Voice clone prerequisite: upload the reference audio (MP3/M4A/WAV, 10s-5min) via
client.Files.UploadFileAsync(purpose: "voice_clone", ...)first, then pass the returnedfile_idtoCreateVoiceCloneAsync. - CLS compliance: extension methods returning
AIFunctionare marked[CLSCompliant(false)]becauseMicrosoft.Extensions.AI.AIFunctionis not CLS-compliant.