Go SDK and examples for MiniMax APIs.
- Speech APIs
- synchronous HTTP TTS
- streaming TTS
- official WebSocket TTS
- async TTS task submit/query
- File upload API
- Voice APIs
- list voices
- voice design
- voice clone
- voice delete
- typed clone/prompt audio uploads
- Image APIs
- text-to-image generation
- image-to-image generation
- Music APIs
- lyrics generation and editing
- non-streaming music generation
- cover preprocess and cover generation
- Video APIs
- text-to-video task submit/query
- image-to-video task submit
- first-last-frame video task submit
- subject-reference video task submit
The detailed API inventory lives in docs/. Current coverage is:
Implemented:
- File upload:
File.Uploadsupports multipart upload and normalized upload metadata. - File list:
File.Listlists stored files by MiniMax purpose. - File retrieve:
File.Retrieveretrieves normalized metadata for a generated or uploaded file. - File download:
File.Downloadopens a raw file content stream for generated files. - File delete:
File.Deletedeletes a stored file by file ID and purpose. - Voice list:
Voice.ListVoicesqueries available system, cloned, and generated voices. - Voice design:
Voice.DesignVoicecreates a custom voice from a prompt and preview text. - Voice delete:
Voice.DeleteVoicedeletes an owned generated/cloned voice by ID. - Voice clone audio uploads:
Voice.UploadCloneAudioandVoice.UploadPromptAudiowrap official file upload purposes. - Speech T2A HTTP:
Speech.Synthesizesupports synchronous HTTP TTS with stable official audio, language, subtitle, and output fields. - Speech T2A WebSocket:
Speech.OpenWebSocketimplements the official/ws/v1/t2a_v2task protocol separately from HTTP stream. - Speech T2A async:
SpeechAsync.SubmitAsyncandSpeechAsync.GetAsyncTasksupport stable official create/query fields and metadata normalization. - Image T2I:
Image.GenerateTextToImagegenerates images from text prompts. - Image I2I:
Image.GenerateImageToImagegenerates images from prompts and subject references. - Music lyrics generation:
Music.GenerateLyricswrites or edits lyrics for music workflows. - Music generation:
Music.Generatecreates non-streaming songs, instrumental tracks, and cover music. - Music cover preprocess:
Music.PreprocessCoverextracts cover features and formatted lyrics for two-step cover workflows. - Video T2V create:
Video.CreateTextToVideocreates async text-to-video tasks. - Video I2V create:
Video.CreateImageToVideocreates async image-to-video tasks. - Video FL2V create:
Video.CreateFirstLastFrameVideocreates async first-last-frame video tasks. - Video S2V create:
Video.CreateSubjectReferenceVideocreates async subject-reference video tasks. - Video generation query:
Video.GetTaskqueries async video task status and generated file IDs.
Partially implemented:
- Speech T2A streaming:
Speech.OpenStreamremains an HTTP/SSE helper for source compatibility; useSpeech.OpenWebSocketfor the official WebSocket protocol. - Voice clone:
Voice.CloneVoicesupportsaudio_urlandfile_id; full official preview/prompt clone fields can be added separately. - Music streaming:
Music.Generaterejectsstream=true; official streaming music response handling is not implemented yet.
Planned:
- Remaining video generation APIs: video agent tasks.
- Text and model APIs: OpenAI/Anthropic-compatible chat, Responses, token estimation, and model list/retrieve endpoints.
- Go
1.26+ - MiniMax API key
Set your API key:
export MINIMAX_API_KEY="your_api_key"Check runnable examples:
go run ./examples/speech -h
go run ./examples/speech async -h
go run ./examples/speech stream -h
go run ./examples/speech websocket -h
go run ./examples/speech http -h
go run ./examples/voice/list -h
go run ./examples/voice/clone -h
go run ./examples/voice/upload -h
go run ./examples/voice/delete -h
go run ./examples/file -h
go run ./examples/image -h
go run ./examples/music -h
go run ./examples/video -hgo fmt ./...
go build ./...
go vet ./...
go test ./...client.go: SDK client and service wiringspeech*.go: speech sync/stream/async APIsvoice.go: voice-related APIsimage.go: image generation APIsmusic.go: music generation and lyrics APIsvideo.go: video generation task APIsfile.go: file management APIsdocs/: official API inventory and implementation status by interfaceinternal/: transport/protocol/stream/codec internalsexamples/: runnable CLI demos