Quick Start
1. Install OpenAI SDK
2. Configure Environment Variables
3. Call API
Supported Models
When using the OpenAI SDK, the following MiniMax models are supported:| Model Name | Description |
|---|---|
| MiniMax-M2 | MiniMax-M2 launching on October 27th, stay tuned |
For more model information, please refer to the standard MiniMax API
documentation.
Examples
Basic Conversation
Streaming Response
Tool Calling (Function Calling)
For more details, see MiniMax-M2 Function Calling GuideImportant Notes
-
Set
OPENAI_BASE_URLtohttps://api.minimax.io/v1when using -
Set
OPENAI_API_KEYto your MiniMax API Key -
The
temperatureparameter range is (0.0, 1.0], recommended value: 1.0, values outside this range will return an error -
Some OpenAI parameters (such as
presence_penalty,frequency_penalty,logit_bias, etc.) will be ignored - Image and audio type inputs are not currently supported
-
The
nparameter only supports value 1 -
The deprecated
function_callis not supported, please use thetoolsparameter
Related Links
Recommended Reading
Text Generation
Supports text generation via compatible Anthropic API and OpenAI API.
M2 for AI Coding Tools
MiniMax-M2 excels at code understanding, dialogue, and reasoning.
Compatible Anthropic API
Use Anthropic SDK with MiniMax models
MiniMax-M2 Function Calling Guide
AI models can call external functions to extend their capabilities.






