npx skills add https://github.com/vm0-ai/vm0-skills --skill minimax通过直接的 curl 调用使用 MiniMax API,实现 AI 聊天补全、文本转语音 和 视频生成。
官方文档:
https://platform.minimax.io/docs
在以下场景中使用此技能:
api.minimaxi.chat(多一个 "i")export MINIMAX_API_KEY="your-api-key"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 区域 | 基础 URL |
|---|---|
| 中国 | https://api.minimax.io |
| 全球 | https://api.minimaxi.chat |
以下所有示例均假设已设置 MINIMAX_API_KEY 环境变量。
身份验证使用 Bearer 令牌,置于 Authorization 请求头中。
发送聊天消息:
写入 /tmp/minimax_request.json:
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, who are you?"}
]
}
然后运行:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.choices[0].message.content'
可用模型:
MiniMax-M2:推理模型(最佳质量)MiniMax-M1:推理模型(均衡)MiniMax-Text-01:标准模型(最快)调整创意性:
写入 /tmp/minimax_request.json:
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "user", "content": "Write a short poem about AI."}
],
"temperature": 0.7,
"max_tokens": 200
}
然后运行:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.choices[0].message.content'
参数:
temperature(0-1):值越高,创意性越强top_p(0-1,默认 0.95):采样多样性max_tokens:最大输出令牌数获取实时输出:
写入 /tmp/minimax_request.json:
{
"model": "MiniMax-M1",
"messages": [
{"role": "user", "content": "Explain quantum computing."}
],
"stream": true
}
然后运行:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json
对于推理模型(M1/M2),推荐使用流式传输。
对复杂任务使用推理模型:
写入 /tmp/minimax_request.json:
{
"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
}
然后运行:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json
响应包含 reasoning_content 字段,显示思考过程。
将文本转换为语音:
写入 /tmp/minimax_request.json:
{
"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"
}
然后运行:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output speech.mp3
为语音添加情感(speech-02 模型):
写入 /tmp/minimax_request.json:
{
"model": "speech-02-hd",
"text": "I am so happy to meet you today!",
"voice_id": "female-shaonv",
"emotion": "happy",
"speed": 1.0,
"format": "mp3"
}
然后运行:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output happy_speech.mp3
情感选项: happy, sad, angry, fearful, disgusted, surprised, neutral
微调音频输出:
写入 /tmp/minimax_request.json:
{
"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"
}
然后运行:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output hq_speech.mp3
TTS 模型:
speech-02-hd:高清(最佳质量)speech-02-turbo:快速生成speech-01-hd:上一代高清speech-01-turbo:上一代快速根据文本提示生成视频:
写入 /tmp/minimax_request.json:
{
"model": "T2V-01-Director",
"prompt": "A cat playing with a ball of yarn [Static shot].",
"duration": 6,
"resolution": "1080P"
}
然后运行:
curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.task_id'
视频生成是异步的 - 返回一个任务 ID 用于轮询完成状态。
控制视频中的摄像机运动:
写入 /tmp/minimax_request.json:
{
"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"
}
然后运行:
curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.task_id'
摄像机指令(置于方括号内):
Truck left/right, Pan left/right, Push in/Pull outPedestal up/down, Tilt up/downZoom in/outShake, Tracking shot, Static shot可使用 [Pan left, Pedestal up] 组合指令(最多同时 3 个)。
根据图像生成视频:
注意: 对于 I2V,请使用支持
first_frame_image的MiniMax-Hailuo-2.3或S2V-01模型。T2V-01-Director模型仅用于文本转视频。
写入 /tmp/minimax_request.json:
{
"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"
}
然后运行:
curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.task_id'
first_frame_image 可以是 URL 或 base64 编码的图像。
在聊天中使用工具:
写入 /tmp/minimax_request.json:
{
"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"
}
然后运行:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.choices[0]'
{
"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,全球使用 api.minimaxi.chatstream: true 效果最佳[方括号] 内speech-02-* 和 speech-01-* 模型每周安装量
200
代码仓库
GitHub 星标
47
首次出现
2026 年 1 月 23 日
安全审计
安装于
opencode184
codex180
gemini-cli180
github-copilot176
cursor176
kimi-cli172
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 |
All examples below assume you have MINIMAX_API_KEY set.
Authentication uses Bearer token in the Authorization header.
Send a chat message:
Write to /tmp/minimax_request.json:
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, who are you?"}
]
}
Then run:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | 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:
Write to /tmp/minimax_request.json:
{
"model": "MiniMax-Text-01",
"messages": [
{"role": "user", "content": "Write a short poem about AI."}
],
"temperature": 0.7,
"max_tokens": 200
}
Then run:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | 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:
Write to /tmp/minimax_request.json:
{
"model": "MiniMax-M1",
"messages": [
{"role": "user", "content": "Explain quantum computing."}
],
"stream": true
}
Then run:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json
Streaming is recommended for reasoning models (M1/M2).
Use reasoning models for complex tasks:
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json
Response includes reasoning_content field with thought process.
Convert text to speech:
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output speech.mp3
Add emotion to speech (speech-02 models):
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --output happy_speech.mp3
Emotion options: happy, sad, angry, fearful, disgusted, surprised, neutral
Fine-tune audio output:
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/t2a_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json --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:
Write to /tmp/minimax_request.json:
{
"model": "T2V-01-Director",
"prompt": "A cat playing with a ball of yarn [Static shot].",
"duration": 6,
"resolution": "1080P"
}
Then run:
curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer $(printenv 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.
Control camera movement in videos:
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.task_id'
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.
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/video_generation" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.task_id'
Provide first_frame_image as URL or base64-encoded image.
Use tools with chat:
Write to /tmp/minimax_request.json:
{
"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:
curl -s "https://api.minimax.io/v1/text/chatcompletion_v2" -X POST -H "Authorization: Bearer $(printenv MINIMAX_API_KEY)" -H "Content-Type: application/json" -d @/tmp/minimax_request.json | jq '.choices[0]'
{
"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-* modelsWeekly Installs
200
Repository
GitHub Stars
47
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode184
codex180
gemini-cli180
github-copilot176
cursor176
kimi-cli172
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
45,700 周安装