MiniMax API via curl. Use this skill for Chinese LLM chat, text-to-speech, and AI video generation.
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
Use the MiniMax API via direct curl calls for AI chat completion, text-to-speech, and video generation.
Official docs:
https://platform.minimax.io/docs
Use this skill when you need to:
api.minimaxi.chat (with extra "i")export MINIMAX_API_KEY="your-api-key"
| Region | Base URL |
|---|---|
| China | https://api.minimax.io |
| Global | https://api.minimaxi.chat |
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
All examples below assume you have MINIMAX_API_KEY set.
Authentication uses Bearer token in the Authorization header.
Send a chat message:
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 '"'"'{
"model": "MiniMax-Text-01",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, who are you?"}
]
}'"'"' | jq '"'"'.choices[0].message.content'"'"''
Available models:
MiniMax-M2: Reasoning model (best quality)MiniMax-M1: Reasoning model (balanced)MiniMax-Text-01: Standard model (fastest)Adjust creativity:
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 '"'"'{
"model": "MiniMax-Text-01",
"messages": [
{"role": "user", "content": "Write a short poem about AI."}
],
"temperature": 0.7,
"max_tokens": 200
}'"'"' | jq '"'"'.choices[0].message.content'"'"''
Parameters:
temperature (0-1): Higher = more creativetop_p (0-1, default 0.95): Sampling diversitymax_tokens: Maximum output tokensGet real-time output:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d '{
"model": "MiniMax-M1",
"messages": [
{"role": "user", "content": "Explain quantum computing."}
],
"stream": true
}'
Streaming is recommended for reasoning models (M1/M2).
Use reasoning models for complex tasks:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d '{
"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
}'
Response includes reasoning_content field with thought process.
Convert text to speech:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d '{
"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"
}' --output speech.mp3
Add emotion to speech (speech-02 models):
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d '{
"model": "speech-02-hd",
"text": "I am so happy to meet you today!",
"voice_id": "female-shaonv",
"emotion": "happy",
"speed": 1.0,
"format": "mp3"
}' --output happy_speech.mp3
Emotion options: happy, sad, angry, fearful, disgusted, surprised, neutral
Fine-tune audio output:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer ${MINIMAX_API_KEY}" -H "Content-Type: application/json" -d '{
"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"
}' --output hq_speech.mp3
TTS models:
speech-02-hd: High definition (best quality)speech-02-turbo: Fast generationspeech-01-hd: Previous gen HDspeech-01-turbo: Previous gen fastGenerate video from text prompt:
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 '"'"'{
"model": "T2V-01-Director",
"prompt": "A cat playing with a ball of yarn [Static shot].",
"duration": 6,
"resolution": "1080P"
}'"'"' | jq .'
Video generation is async - returns a task ID to poll for completion.
Control camera movement in videos:
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 '"'"'{
"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"
}'"'"' | jq .'
Camera commands (in brackets):
Truck left/right, Pan left/right, Push in/Pull outPedestal up/down, Tilt up/downZoom in/outShake, Tracking shot, Static shotCombine with [Pan left, Pedestal up] (max 3 simultaneous).
Generate video from an image:
Note: For I2V, use
MiniMax-Hailuo-2.3orS2V-01model which supportsfirst_frame_image. TheT2V-01-Directormodel is text-to-video only.
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 '"'"'{
"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"
}'"'"' | jq .'
Provide first_frame_image as URL or base64-encoded image.
Use tools with chat:
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 '"'"'{
"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"
}'"'"' | jq .'
{
"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
}
}
api.minimax.io, global uses api.minimaxi.chatstream: true[brackets] within promptsspeech-02-* and speech-01-* models