Skip to content

GizClaw/minimax-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minimax-go

Go CI CodeQL Go Report Card

Go SDK and examples for MiniMax APIs.

What is included

  • 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

Roadmap

The detailed API inventory lives in docs/. Current coverage is:

Implemented:

  • File upload: File.Upload supports multipart upload and normalized upload metadata.
  • File list: File.List lists stored files by MiniMax purpose.
  • File retrieve: File.Retrieve retrieves normalized metadata for a generated or uploaded file.
  • File download: File.Download opens a raw file content stream for generated files.
  • File delete: File.Delete deletes a stored file by file ID and purpose.
  • Voice list: Voice.ListVoices queries available system, cloned, and generated voices.
  • Voice design: Voice.DesignVoice creates a custom voice from a prompt and preview text.
  • Voice delete: Voice.DeleteVoice deletes an owned generated/cloned voice by ID.
  • Voice clone audio uploads: Voice.UploadCloneAudio and Voice.UploadPromptAudio wrap official file upload purposes.
  • Speech T2A HTTP: Speech.Synthesize supports synchronous HTTP TTS with stable official audio, language, subtitle, and output fields.
  • Speech T2A WebSocket: Speech.OpenWebSocket implements the official /ws/v1/t2a_v2 task protocol separately from HTTP stream.
  • Speech T2A async: SpeechAsync.SubmitAsync and SpeechAsync.GetAsyncTask support stable official create/query fields and metadata normalization.
  • Image T2I: Image.GenerateTextToImage generates images from text prompts.
  • Image I2I: Image.GenerateImageToImage generates images from prompts and subject references.
  • Music lyrics generation: Music.GenerateLyrics writes or edits lyrics for music workflows.
  • Music generation: Music.Generate creates non-streaming songs, instrumental tracks, and cover music.
  • Music cover preprocess: Music.PreprocessCover extracts cover features and formatted lyrics for two-step cover workflows.
  • Video T2V create: Video.CreateTextToVideo creates async text-to-video tasks.
  • Video I2V create: Video.CreateImageToVideo creates async image-to-video tasks.
  • Video FL2V create: Video.CreateFirstLastFrameVideo creates async first-last-frame video tasks.
  • Video S2V create: Video.CreateSubjectReferenceVideo creates async subject-reference video tasks.
  • Video generation query: Video.GetTask queries async video task status and generated file IDs.

Partially implemented:

  • Speech T2A streaming: Speech.OpenStream remains an HTTP/SSE helper for source compatibility; use Speech.OpenWebSocket for the official WebSocket protocol.
  • Voice clone: Voice.CloneVoice supports audio_url and file_id; full official preview/prompt clone fields can be added separately.
  • Music streaming: Music.Generate rejects stream=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.

Requirements

  • Go 1.26+
  • MiniMax API key

Quick start

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 -h

Development checks

go fmt ./...
go build ./...
go vet ./...
go test ./...

Repository layout

  • client.go: SDK client and service wiring
  • speech*.go: speech sync/stream/async APIs
  • voice.go: voice-related APIs
  • image.go: image generation APIs
  • music.go: music generation and lyrics APIs
  • video.go: video generation task APIs
  • file.go: file management APIs
  • docs/: official API inventory and implementation status by interface
  • internal/: transport/protocol/stream/codec internals
  • examples/: runnable CLI demos

Releases

Packages

Contributors

Languages