StarMagicStarMagic
English
简体中文简繁體中文繁EnglishEN日本語日EspañolES한국어KO
Integration Guide
MiniMax-M3 - OpenAI-Compatible APIMiniMax-M3 - Anthropic-Compatible API
StarMagicStarMagic
English
简体中文简繁體中文繁EnglishEN日本語日EspañolES한국어KO
TextMiniMaxMinimax.M3

MiniMax-M3 - OpenAI-Compatible API

  • Use the OpenAI Chat Completions protocol to call the MiniMax-M3 model
  • Multi-turn conversation: Supports single-turn or multi-turn contextual dialogue
  • System prompts: Customize AI role and behavior via role=system messages
  • Multimodal input: content supports mixed text + image / video
  • Thinking mode: Controlled via thinking.type; thinking content is returned via reasoning_content
  • Streaming output: Supports SSE streaming responses
  • Tool calling: Supports Function Calling
<Note> **BaseURL**: The default BaseURL is `https://api.starmagic.ai`, which has better support for text models and long-lived connections. `https://api.starmagic.ai` is the primary endpoint for multimodal services and serves as a fallback address for text models. </Note>

Authorization

AuthorizationstringheaderRequired

##All APIs require Bearer Token authentication## **Get API Key:** Visit [API Key Management Page](https://starmagic.ai/app/api-keys) to get your API Key **Add to request header:** ``` Authorization: Bearer YOUR_API_KEY ```

Authorization: Bearer YOUR_API_KEY

Request body

application/json
modelenum<MiniMax-M3>Required

Chat model name

"MiniMax-M3"
messagesobject[]Required

List of conversation messages, supports multi-turn dialogue Messages with different roles have different field structures; select the corresponding role to view

[
  null
]
thinkingobject

Controls deep thinking **Notes**: - **Defaults to `adaptive`**: The model adaptively decides whether to engage in deep thinking based on problem difficulty - By default, thinking content is inlined in the response `content` (wrapped in `<think>...</think>` tags); to separate it into a dedicated field, use `reasoning_split`

{
  "type": "adaptive"
}
reasoning_splitboolean

Whether to split thinking content into a separate field - `false` (default): Thinking content is inlined in `content`, wrapped in `<think>...</think>` tags - `true`: Thinking content is split into `choices[].message.reasoning_content` and `reasoning_details`

true
temperaturenumber

Sampling temperature, controls output randomness **Notes**: - Lower values (e.g. 0.2): More deterministic, focused output - Higher values (e.g. 1.5): More random, creative output - Range: `[0, 2]`, default 1

1
top_pnumber

Nucleus Sampling parameter **Notes**: - Controls sampling from tokens with cumulative probability - e.g. 0.95 means selecting from tokens reaching 95% cumulative probability - Range: `[0, 1]`, MiniMax-M3 default 0.95 **Recommendation**: Do not adjust temperature and top_p simultaneously

0.95
max_completion_tokensinteger

Upper limit for generated content length (in tokens) **Notes**: - MiniMax-M3 recommended **131,072** (128K), maximum **524,288** (512K) - Tokens generated by thinking also count toward this limit - If generation is interrupted due to `length`, try increasing this value

131072
streamboolean

Whether to return the response in streaming mode - `true`: Streaming response, returns content in real-time chunks via SSE (Server-Sent Events) - `false`: Wait for complete response before returning (default)

false
stream_optionsobject

Streaming response options Only effective when `stream=true`

{
  "include_usage": true
}
toolsobject[]

Tool definition list for Function Calling Each tool requires a name, description, and parameter schema

[
  {
    "type": "function",
    "function": {
      "name": "string",
      "description": "string",
      "parameters": {}
    }
  }
]
max_tokensinteger

Legacy generation length limit parameter **Note**: Deprecated, please use `max_completion_tokens` instead

0

Response

application/json
成功

Response body

idstring

Unique identifier for the chat completion

"0668a381bdc3c0ded310e27c9a46d16e7"
modelstring

Model name actually used

"MiniMax-M3"
objectenum<chat.completion>

Response type

"chat.completion"
createdinteger

Creation timestamp (Unix seconds)

1777026807
choicesobject[]

List of chat completion choices

[
  {
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! I'm MiniMax-M3, and I can help you with conversation, writing, reasoning, coding, and many other tasks.",
      "reasoning_content": "Let me analyze this problem...",
      "reasoning_details": [
        {
          "type": null,
          "id": null,
          "format": null,
          "index": null,
          "text": null
        }
      ],
      "name": "string",
      "audio_content": "string",
      "tool_calls": [
        {
          "id": null,
          "type": null,
          "function": null,
          "index": null
        }
      ]
    },
    "finish_reason": "stop"
  }
]
usageobject

Token usage statistics

{
  "total_tokens": 1604,
  "total_characters": 0,
  "prompt_tokens": 1365,
  "completion_tokens": 239,
  "prompt_tokens_details": {
    "cached_tokens": 114
  }
}
input_sensitiveboolean

Whether the input content triggered a sensitive word filter. If the input severely violates policies, the API will return a content violation error with empty response content

true
input_sensitive_typeinteger

Type of sensitive word triggered by input (returned when `input_sensitive` is true): 1 severe violation; 2 pornography; 3 advertising; 4 prohibited content; 5 abusive language; 6 violence/terrorism; 7 other

0
output_sensitiveboolean

Whether the output content triggered a sensitive word filter

true
output_sensitive_typeinteger

Type of sensitive word triggered by output

0
base_respobject

Status code and error details

{
  "status_code": 0,
  "status_msg": "string"
}
POST/v1/chat/completions
curl --request POST \
  --url https://api.starmagic.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "MiniMax-M3",
  "messages": [
    {
      "role": "user",
      "content": "Please introduce yourself"
    }
  ]
}'
Response: 成功
{
  "id": "066b36619b147e326d17053cccdef70f",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "<think>\nThe user is asking about the capital of France, which is a common knowledge question. The answer is Paris.\n</think>\nThe capital of France is **Paris**.",
        "role": "assistant",
        "name": "MiniMax AI",
        "audio_content": ""
      }
    }
  ],
  "created": 1777026807,
  "model": "MiniMax-M3",
  "object": "chat.completion",
  "usage": {
    "total_tokens": 60,
    "total_characters": 0,
    "prompt_tokens": 7,
    "completion_tokens": 53,
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "input_sensitive": false,
  "output_sensitive": false,
  "input_sensitive_type": 0,
  "output_sensitive_type": 0,
  "base_resp": {
    "status_code": 0,
    "status_msg": ""
  }
}

MiniMax-M2.5 - 完整参数文档

Previous Page

MiniMax-M3 - Anthropic-Compatible API

Next Page