Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gmicloud.ai/llms.txt

Use this file to discover all available pages before exploring further.

Model ID
MiniMaxAI/MiniMax-M2.1

API Usage

You can interact with the MiniMax-M2.1 model through various programming languages and methods. Below are examples showing how to use the model’s API.

API Examples

Generate a model response using the chat endpoint of MiniMax-M2.1.

Shell

curl --request POST \
  --url https://api.gmi-serving.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "model": "MiniMaxAI/MiniMax-M2.1",
    "messages": [
      {"role": "system", "content": "You are a helpful AI assistant with strong reasoning and coding ability."},
      {"role": "user", "content": "Explain how the Mixture-of-Experts architecture improves inference efficiency in large language models."}
    ],
    "temperature": 0.7,
    "max_tokens": 512
  }'

example for function call

curl --request POST \
  --url https://api.gmi-serving.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "temperature": 0,
    "max_tokens": 100,
    "model": ""MiniMaxAI/MiniMax-M2.1",
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "query_weather",
                "description": "Get weather of an city, the user should supply a city first",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "city": {
                            "type": "string",
                            "description": "The city, e.g. Beijing"
                        }
                    },
                    "required": [
                        "city"
                    ]
                }
            }
        }
    ],
    "messages": [
        {
            "role": "user",
            "content": "Hows the weather like in Qingdao today"
        }
    ]
}'

Python

import requests
import json

url = "https://api.<provider>.com/v1/chat/completions"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}

payload = {
    "model": "MiniMaxAI/MiniMax-M2.1",
    "messages": [
        {"role": "system", "content": "You are a capable AI coding assistant"},
        {"role": "user",   "content": "Refactor this multi-file Python module to make it async-ready"}
    ],
    "temperature": 0,
    "max_tokens": 512
}

response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))