MESSAGES
Create a Message
Send a structured list of input messages and receive a model-generated response. Supports text, images, tool use, and extended thinking.
Authorization
AuthorizationstringheaderrequiredBearer token — your API key. Example: Bearer sk-...
Request body
application/jsonmodelstringrequiredThe model to use (e.g. MiniMax-M2.5).
messagesobject[]requiredAn array of input messages. Each message has a role (user or assistant) and content.
max_tokensintegerrequiredThe maximum number of tokens to generate before stopping.
systemstring | object[]System prompt — provides instructions and context to the model. Can be a string or array of system blocks.
toolsobject[]Definitions of tools the model may use. Each tool has a name, description, and input schema.
tool_choice"auto" | "any" | objectControls which tool (if any) the model calls. 'auto' lets the model decide, 'any' forces tool use, 'none' disables tools, or specify a tool by name.
stop_sequencesstring[]Custom sequences that will cause the model to stop generating. The stop sequence itself is not included in the response.
temperaturenumberSampling temperature between 0 and 1. Higher values (e.g. 0.8) make output more random, lower values (e.g. 0.2) make it more deterministic. Defaults to 1.
top_pnumberNucleus sampling: only consider tokens whose cumulative probability exceeds this value. Recommended to use temperature or top_p, but not both.
top_kintegerOnly sample from the top K most likely tokens at each step. Recommended to use either temperature, top_p, or top_k.
streambooleanWhether to stream the response using server-sent events. When true, the response is sent as a series of SSE events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, and message_stop.
thinkingobjectConfiguration for extended thinking. When enabled, the model can use internal reasoning before responding.
metadataobjectOptional metadata about the request.
Response
idstringrequiredUnique message identifier (e.g. msg_01XFDUDYJgAACzvnptvVoYEL).
type"message"requiredObject type — always "message".
role"assistant"requiredThe role — always "assistant".
contentobject[]requiredArray of content blocks generated by the model.
modelstringrequiredThe model that handled the request.
stop_reason"end_turn" | "max_tokens" | "stop_sequence" | "tool_use"requiredThe reason the model stopped generating. end_turn: natural stop, max_tokens: hit the limit, stop_sequence: matched a stop sequence, tool_use: the model invoked a tool.
end_turnmax_tokensstop_sequencetool_usestop_sequencestringrequiredThe stop sequence that caused the model to stop, if applicable.
usageobjectrequiredRequest
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "your-scx-api-key",
baseURL: "https://api.scx.ai",
});
const message = await client.messages.create({
model: "MiniMax-M2.5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, how are you?" }],
});
console.log(message);import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "your-scx-api-key",
baseURL: "https://api.scx.ai",
});
const message = await client.messages.create({
model: "MiniMax-M2.5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, how are you?" }],
});
console.log(message);Response
{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! I'm doing well, thank you for asking. How can I help you today?"
}
],
"model": "MiniMax-M2.5",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 18
}
}{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! I'm doing well, thank you for asking. How can I help you today?"
}
],
"model": "MiniMax-M2.5",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 18
}
}