MiniMax SDK
Go and Rust SDK for the MiniMax AI platform API.
Official API Documentation: api/README.md
Design Goals
- Full API Coverage: Support all MiniMax API capabilities
- Idiomatic Language Design: Natural Go/Rust patterns
- Streaming Support: First-class support for streaming responses
- Async Task Handling: Convenient polling for long-running operations
API Coverage
| API Feature | Go | Rust | Official Doc |
|---|---|---|---|
| Text Generation (Chat) | ✅ | ✅ | api/text.md |
| Sync Speech (T2A) | ✅ | ✅ | api/speech-t2a.md |
| Async Speech (Long Text) | ✅ | ✅ | api/speech-t2a-async.md |
| Voice Cloning | ✅ | ✅ | api/voice-cloning.md |
| Voice Design | ✅ | ✅ | api/voice-design.md |
| Voice Management | ✅ | ✅ | api/voice-management.md |
| Video Generation | ✅ | ✅ | api/video.md |
| Video Agent | ✅ | ✅ | api/video-agent.md |
| Image Generation | ✅ | ✅ | api/image.md |
| Music Generation | ✅ | ✅ | api/music.md |
| File Management | ✅ | ✅ | api/file.md |
Architecture
graph TB
subgraph client["Client"]
subgraph services1[" "]
text[Text Service]
speech[Speech Service]
voice[Voice Service]
video[Video Service]
end
subgraph services2[" "]
image[Image Service]
music[Music Service]
file[File Service]
end
end
subgraph http["HTTP Client"]
retry[Retry]
auth[Auth]
error[Error Handling]
end
client --> http
http --> api["https://api.minimaxi.com"]
Services
| Service | Description |
|---|---|
Text | Chat completion, streaming, tool calls |
Speech | TTS sync/stream, async long-text |
Voice | List voices, clone, design |
Video | Text-to-video, image-to-video, agent |
Image | Text-to-image, image reference |
Music | Music generation from lyrics |
File | Upload, list, retrieve, delete files |
Authentication
Uses Bearer token authentication:
Authorization: Bearer <api_key>
API keys are obtained from MiniMax Platform.
Base URLs
| Region | URL |
|---|---|
| China (Default) | https://api.minimaxi.com |
| Global | https://api.minimaxi.chat |
Response Patterns
Synchronous
Direct response with data.
Streaming
SSE (Server-Sent Events) for real-time data:
- Text: Token-by-token chat responses
- Speech: Audio chunk streaming
Async Tasks
For long-running operations (video, async speech):
sequenceDiagram
participant C as Client
participant S as Server
C->>S: Create Task
S-->>C: task_id
loop Poll Status
C->>S: Query Status
S-->>C: Pending/Running
end
S-->>C: Success + Result
Error Handling
All errors include:
status_code: Numeric error codestatus_msg: Human-readable message
Common error codes:
1000: General error1001: Rate limit exceeded1002: Invalid parameters1004: Authentication failed
Examples Directory
examples/go/minimax/- Go SDK examplesexamples/rust/minimax/- Rust SDK examplesexamples/cmd/minimax/- CLI test scripts
Related
- CLI tool:
go/cmd/minimax/ - CLI tests:
examples/cmd/minimax/