Skip to main content
POST
/
v1
/
chat
/
completions
curl --request POST \
  --url https://api.minimax.io/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "model": "MiniMax-M2.7",
  "messages": [
    {
      "role": "system",
      "name": "MiniMax AI"
    },
    {
      "role": "user",
      "name": "User",
      "content": "Hello"
    }
  ]
}
'
{
  "id": "0637a03982880edad2460180345734fe",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "<think>\nThe user just says \"Hello\". This is a simple greeting. I should respond with a friendly greeting and offer to help.\n</think>\n\nHello! How can I help you today?",
        "role": "assistant",
        "name": "MiniMax AI",
        "audio_content": ""
      }
    }
  ],
  "created": 1776839993,
  "model": "MiniMax-M2.7",
  "object": "chat.completion",
  "usage": {
    "total_tokens": 80,
    "total_characters": 0,
    "prompt_tokens": 42,
    "completion_tokens": 38,
    "completion_tokens_details": {
      "reasoning_tokens": 29
    }
  },
  "input_sensitive": false,
  "output_sensitive": false,
  "input_sensitive_type": 0,
  "output_sensitive_type": 0,
  "output_sensitive_int": 0,
  "base_resp": {
    "status_code": 0,
    "status_msg": ""
  }
}

Authorizations

Authorization
string
header
required

HTTP: Bearer Auth

  • Security Scheme Type: http
  • HTTP Authorization Scheme: Bearer API_key, used for account verification, can be viewed in Account Management > API Keys

Headers

Content-Type
enum<string>
default:application/json
required

Media type of the request body, should be set to application/json to ensure JSON format

Available options:
application/json

Body

application/json
model
enum<string>
required

Model ID

Available options:
MiniMax-M2.7,
MiniMax-M2.7-highspeed,
MiniMax-M2.5,
MiniMax-M2.1
messages
object[]
required

A list of messages containing the conversation history. For more details on message parameters, refer to Text Chat Guide

stream
boolean
default:false

Whether to use streaming output, defaults to false. When set to true, the response will be returned in chunks

max_completion_tokens
integer<int64>

Specifies the upper limit for generated content length (in tokens), maximum is 2048. Content exceeding the limit will be truncated. If generation stops due to length, try increasing this value

Required range: x >= 1
temperature
number<double>
default:1

Temperature coefficient, affects output randomness, value range (0, 1], default value for MiniMax-M2.7 model is 1.0. Higher values produce more random output; lower values produce more deterministic output

Required range: 0 < x <= 1
top_p
number<double>
default:0.95

Sampling strategy, affects output randomness, value range (0, 1], default value for MiniMax-M2.7 model is 0.95

Required range: 0 < x <= 1

Response

id
string

Unique ID of this response

choices
object[]

List of response choices

created
integer<int64>

Unix timestamp (seconds) when the response was created

model
string

Model ID used for this request

object
enum<string>

Object type. chat.completion for non-streaming, chat.completion.chunk for streaming

Available options:
chat.completion,
chat.completion.chunk
usage
object

Token usage statistics for this request

input_sensitive
boolean

Whether the input content triggered sensitive word detection. If the input content is severely inappropriate, the API will return a content violation error message with empty reply content

input_sensitive_type
integer<int64>

Type of sensitive word triggered by input, returned when input_sensitive is true. Values: 1 Severe violation; 2 Pornography; 3 Advertising; 4 Prohibited; 5 Abuse; 6 Violence/Terrorism; 7 Other

output_sensitive
boolean

Whether the output content triggered sensitive word detection. If the output content is severely inappropriate, the API will return a content violation error message with empty reply content

output_sensitive_type
integer<int64>

Type of sensitive word triggered by output

base_resp
object

Error status code and details