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 - Anthropic-Compatible API

  • Use the Anthropic Messages protocol to call the MiniMax-M3 model
  • Request / response structure aligns with the Anthropic API
  • Multimodal conversation: content supports text and image content blocks
  • System prompts: Passed via the top-level system field
  • Thinking mode: Controlled via the thinking object; thinking content is returned via content[type=thinking] block
  • Streaming output: SSE event stream
  • Tool calling: Compatible with Anthropic tool_use / tool_result flow
<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 ``` **Note**: EvoLink uses Bearer Token authentication uniformly for `/v1/messages`.

Authorization: Bearer YOUR_API_KEY

Request body

application/json
modelenum<MiniMax-M3>Required

Model to call

"MiniMax-M3"
max_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 - Content exceeding the limit will be truncated; if generation is interrupted due to `length`, try increasing this value

1024
messagesobject[]Required

List of conversation messages, alternating user / assistant turns **Notes**: - Must contain at least 1 message - The last message is typically `role=user`

[
  {
    "role": "user",
    "content": null
  }
]
systemobject

System prompt, used to set the AI's role and behavior **Notes**: - Supports a string or an array of strings - Passed via the top-level `system` field

temperaturenumber

Sampling temperature **Notes**: - Range: `[0, 2]` - Default 1; higher values produce more divergent output, lower values produce more deterministic output

1
top_pnumber

Nucleus sampling threshold **Notes**: - Range: `[0, 1]`, MiniMax-M3 default 0.95 - It is recommended not to adjust temperature and top_p simultaneously

0.95
streamboolean

Whether to return via SSE streaming - `true`: Server-Sent Events streaming response - `false`: Wait for complete response before returning (default)

false
thinkingobject

Controls deep thinking. When thinking is enabled, thinking blocks must be passed back as-is in multi-turn conversations **Notes**: - **Defaults to `adaptive`**: The model adaptively decides whether to engage in deep thinking based on problem difficulty - When enabled, the response `content` array will include a `type="thinking"` reasoning block (billed as output tokens)

{
  "type": "adaptive"
}
toolsobject[]

Tool definition list **Notes**: - Follows the Anthropic tool definition specification - `input_schema` uses a JSON Schema object

[
  {
    "name": "string",
    "description": "string",
    "input_schema": {},
    "cache_control": {
      "type": "ephemeral"
    }
  }
]
tool_choiceobject

Tool selection strategy. Only auto and none are supported

{
  "type": "auto"
}
metadataobject

Request metadata

{
  "user_id": "string"
}

Response

application/json
成功

Response body

idstring

Unique message ID

"string"
typeenum<message>

Response object type

"message"
roleenum<assistant>
"assistant"
modelstring

Model actually used

"MiniMax-M3"
contentobject[]

Response content block list **Possible block types**: - `thinking`: Reasoning process (only when thinking is active) - `text`: Final answer text - `tool_use`: Tool call initiated by the model

[
  {
    "type": "text",
    "text": "string",
    "thinking": "string",
    "signature": "string",
    "id": "string",
    "name": "string",
    "input": {}
  }
]
stop_reasonenum<end_turn | max_tokens | tool_use>

Stop reason - `end_turn`: Natural completion - `max_tokens`: Reached max_tokens limit - `tool_use`: Model triggered a tool call

"end_turn"
usageobject

Token usage statistics (Anthropic specification)

{
  "input_tokens": 7,
  "output_tokens": 77,
  "cache_creation_input_tokens": 0,
  "cache_read_input_tokens": 0
}
POST/v1/messages
curl --request POST \
  --url https://api.starmagic.ai/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "MiniMax-M3",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Hello, world"
    }
  ]
}'
Response: 成功
{
  "id": "066a381bdc3c0ded310e27c9a46d16e7",
  "type": "message",
  "role": "assistant",
  "model": "MiniMax-M3",
  "content": [
    {
      "type": "thinking",
      "thinking": "The user is asking about the capital of Japan, which is a basic geography question. The answer is Tokyo, I can give it directly.",
      "signature": "066a381bdc3c0ded310e27c9a46d16e7"
    },
    {
      "type": "text",
      "text": "The capital of Japan is **Tokyo**."
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 7,
    "output_tokens": 77,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0
  }
}

MiniMax-M3 - OpenAI-Compatible API

Previous Page

GPT Image 1.5 Image Generation

Next Page