minimax
Original:🇺🇸 English
Translated
MiniMax API via curl. Use this skill for Chinese LLM chat, text-to-speech, and AI video generation.
6installs
Sourcevm0-ai/vm0-skills
Added on
NPX Install
npx skill4agent add vm0-ai/vm0-skills minimaxTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →MiniMax API
Use the MiniMax API via direct calls for AI chat completion, text-to-speech, and video generation.
curlOfficial docs:https://platform.minimax.io/docs
When to Use
Use this skill when you need to:
- Chat completion with Chinese-optimized LLM (MiniMax-M1/M2)
- Text-to-speech with natural voices and emotion control
- Video generation from text prompts (T2V)
- Image-to-video conversion (I2V)
Prerequisites
- Sign up at MiniMax Platform
- Go to Account Management > API Keys to create an API key
- Note: Global users should use (with extra "i")
api.minimaxi.chat
bash
export MINIMAX_API_KEY="your-api-key"API Hosts
| Region | Base URL |
|---|---|
| China | |
| Global | |
Important: When usingin a command that pipes to another command, wrap the command containing$VARin$VAR. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c '...'bashbash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
How to Use
All examples below assume you have set.
MINIMAX_API_KEYAuthentication uses Bearer token in the header.
Authorization1. Basic Chat Completion
Send a chat message:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, who are you?"}
]
}Then run:
bash
bash -c 'curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json' | jq '.choices[0].message.content'Available models:
- : Reasoning model (best quality)
MiniMax-M2 - : Reasoning model (balanced)
MiniMax-M1 - : Standard model (fastest)
MiniMax-Text-01
2. Chat with Temperature Control
Adjust creativity:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "user", "content": "Write a short poem about AI."}
],
"temperature": 0.7,
"max_tokens": 200
}Then run:
bash
bash -c 'curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json' | jq '.choices[0].message.content'Parameters:
- (0-1): Higher = more creative
temperature - (0-1, default 0.95): Sampling diversity
top_p - : Maximum output tokens
max_tokens
3. Streaming Response
Get real-time output:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-M1",
"messages": [
{"role": "user", "content": "Explain quantum computing."}
],
"stream": true
}Then run:
bash
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.jsonStreaming is recommended for reasoning models (M1/M2).
4. Reasoning Model (M1/M2)
Use reasoning models for complex tasks:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-M1",
"messages": [
{"role": "user", "content": "Solve step by step: A train travels 120km in 2 hours. What is its average speed in m/s?"}
],
"stream": true
}Then run:
bash
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.jsonResponse includes field with thought process.
reasoning_content5. Text-to-Speech (Basic)
Convert text to speech:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "speech-02-hd",
"text": "Hello, this is a test of MiniMax text to speech.",
"voice_id": "male-qn-qingse",
"speed": 1.0,
"format": "mp3"
}Then run:
bash
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output speech.mp36. TTS with Emotion
Add emotion to speech (speech-02 models):
Write to :
/tmp/minimax_request.jsonjson
{
"model": "speech-02-hd",
"text": "I am so happy to meet you today!",
"voice_id": "female-shaonv",
"emotion": "happy",
"speed": 1.0,
"format": "mp3"
}Then run:
bash
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output happy_speech.mp3Emotion options: , , , , , ,
happysadangryfearfuldisgustedsurprisedneutral7. TTS with Audio Settings
Fine-tune audio output:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "speech-02-hd",
"text": "High quality audio test.",
"voice_id": "male-qn-qingse",
"speed": 1.0,
"vol": 1.0,
"pitch": 0,
"audio_sample_rate": 32000,
"bitrate": 128000,
"format": "mp3"
}Then run:
bash
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output hq_speech.mp3TTS models:
- : High definition (best quality)
speech-02-hd - : Fast generation
speech-02-turbo - : Previous gen HD
speech-01-hd - : Previous gen fast
speech-01-turbo
8. Text-to-Video (T2V)
Generate video from text prompt:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "T2V-01-Director",
"prompt": "A cat playing with a ball of yarn [Static shot].",
"duration": 6,
"resolution": "1080P"
}Then run:
bash
bash -c 'curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json' | jq '.task_id'Video generation is async - returns a task ID to poll for completion.
9. T2V with Camera Control
Control camera movement in videos:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-Hailuo-2.3",
"prompt": "A person walking through a forest [Tracking shot], then stops to look at a bird [Push in].",
"duration": 6,
"resolution": "1080P"
}Then run:
bash
bash -c 'curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json' | jq '.task_id'Camera commands (in brackets):
- Movement: ,
Truck left/right,Pan left/rightPush in/Pull out - Vertical: ,
Pedestal up/downTilt up/down - Zoom:
Zoom in/out - Special: ,
Shake,Tracking shotStatic shot
Combine with (max 3 simultaneous).
[Pan left, Pedestal up]10. Image-to-Video (I2V)
Generate video from an image:
Note: For I2V, useorMiniMax-Hailuo-2.3model which supportsS2V-01. Thefirst_frame_imagemodel is text-to-video only.T2V-01-Director
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-Hailuo-2.3",
"prompt": "The scene comes to life with gentle movement [Static shot].",
"first_frame_image": "https://example.com/image.jpg",
"duration": 6,
"resolution": "1080P"
}Then run:
bash
bash -c 'curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json' | jq '.task_id'Provide as URL or base64-encoded image.
first_frame_image11. Function Calling (Tools)
Use tools with chat:
Write to :
/tmp/minimax_request.jsonjson
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "user", "content": "What is the weather in Beijing?"}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}
}
],
"tool_choice": "auto"
}Then run:
bash
bash -c 'curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d @/tmp/minimax_request.json' | jq '.choices[0]'Response Format
Chat Completion
json
{
"id": "string",
"choices": [{
"message": {
"role": "assistant",
"content": "Response text",
"reasoning_content": "Thought process (M1/M2 only)"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 50,
"total_tokens": 60
}
}Guidelines
- Use correct host: China uses , global uses
api.minimax.ioapi.minimaxi.chat - Streaming for reasoning: M1/M2 models work best with
stream: true - Camera syntax: Video commands go in within prompts
[brackets] - Emotion in TTS: Only works with and
speech-02-*modelsspeech-01-* - Async video: Video generation returns task ID - poll for completion
- Chinese optimized: MiniMax excels at Chinese language tasks