Anthropic Messages API Compatibility
Request Address
https://api.xiaomimimo.com/anthropic/v1/messages
Request Headers
The API supports the following two authentication methods. Please choose one and add it to the request headers:
api-key: $MIMO_API_KEY
Content-Type: application/json
Request Body
- messagesarrayRequiredInput messages. Each input message must be an object with a
roleandcontent.
Each input messagecontentmay be either a singlestringor an array of content blocks, where each block has a specifictype. Using astringforcontentis shorthand for an array of one content block of typetext.Hide child attributesmessages.rolestringRequiredRole of the message.
Available options:user,assistantmessages.contentstring | arrayRequiredHide child attributesThe text contents of the message. - modelstringRequiredThe model that will complete your prompt.
Available options:mimo-v2.5-pro,mimo-v2.5 - max_tokensintegerThe maximum number of tokens to generate before stopping.
Note that our models may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.mimo-v2.5-pro: default131072mimo-v2.5: default32768
[1, 131072] - stop_sequencesarrayCustom text sequences that will cause the model to stop generating.
Our models will normally stop when they have naturally completed their turn, which will result in a responsestop_reasonofend_turn.
If you want the model to stop generating when it encounters custom strings of text, you can use thestop_sequencesparameter. - streambooleanDefault: falseWhether to incrementally stream the response using server-sent events.
- systemstring | arrayA system prompt is a way of providing context and instructions to model, such as specifying a particular goal or role.Hide child attributesThe content of the system prompt.
- temperaturenumberSampling temperature controls the diversity of the text generated by the model.
The higher the temperature, the more diverse the generated text will be; conversely, the lower the temperature, the more deterministic the generated text will be.In thinking mode, the
mimo-v2.5-pro,mimo-v2.5models do not support customizing thetemperatureparameter. Even if this parameter is passed in, it will be forcibly overridden and take effect with the model's recommended default value of1.0.mimo-v2.5-pro,mimo-v2.5: default1.0
[0, 1.5] - thinkingobjectConfiguration for enabling model's extended thinking.
Note: During the multi-turn tool calls process in thinking mode, the model returns a
thinkingcontent block alongsidetool_usecontent block. To continue the conversation, it is recommended to keep all previousthinkingcontent block in themessagesarray for each subsequent request to achieve the best performance.In thinking mode, the
mimo-v2.5-pro,mimo-v2.5models do not support customizing thetemperatureandtop_pparameters. Even if these parameters are passed in, the actual effective values will be forcibly set by the model to its recommended default values of1.0and0.95.Hide child attributesthinking.typestringRequiredmimo-v2.5-pro,mimo-v2.5: defaultenabled
enabled,disabled - tool_choiceobjectHow the model should use the provided tools.Hide child attributestool_choice.typestringRequired
automeans the model will automatically decide whether to use tools.
Note: When a value other than
Available options:autois passed totype, the backend will remove this field by default, and the model response behavior will still be equivalent to theautomode (this logic is subject to future adjustments).autotool_choice.disable_parallel_tool_usebooleanDefault: falseWhether to disable parallel tool use.
If set totrue:- When type is
auto, the model will output at most one tool use.
- toolsarrayDefinitions of tools that the model may use.
If you includetoolsin your API request, the model may returntool_usecontent blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model usingtool_resultcontent blocks.Note: During the multi-turn tool calls process in thinking mode, the model returns a
Each tool definition includes:thinkingcontent block alongsidetool_usecontent block. To continue the conversation, it is recommended to keep all previousthinkingcontent block in themessagesarray for each subsequent request to achieve the best performance.name: Name of the tool.description: Optional, but strongly-recommended description of the tool.input_schema: JSON schema for the toolinputshape that the model will produce intool_useoutput content blocks.
Hide child attributestools.namestringRequiredName of the tool.
This is how the tool will be called by the model and intool_useblocks.tools.descriptionstringDescription of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.tools.typestringAvailable options:customtools.input_schemaobjectRequiredJSON schema for the tool input shape that the model will produce intool_useoutput content blocks.Hide child attributestools.input_schema.typestringRequiredThe type ofinput_schema, onlyobjectis supported.
Available options:objecttools.input_schema.propertiesobject | nullThe properties of the tool input.tools.input_schema.requiredarray | nullThe list of properties that must be included in the tool input. - top_pnumberDefault: 0.95Use nucleus sampling.
In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified bytop_p. You should either altertemperatureortop_p, but not both.
Recommended for advanced use cases only. You usually only need to usetemperature.In thinking mode, the
Required range:mimo-v2.5-pro,mimo-v2.5models do not support customizing thetop_pparameter. Even if this parameter is passed in, it will be forcibly overridden and take effect with the model's recommended default value of0.95.[0.01, 1.0]
Non-streaming Response
- idstringUnique object identifier. The format and length of IDs may change over time.
- typestringFor Messages, this is always
message. - rolestringConversational role of the generated message. This will always be
assistant. - contentarrayContent generated by the model.Hide child attributesHide child attributescontent.textstringThe content of the text.content.typestringThe type of the content.
Available options:text - modelstringThe model that handled the request.
- stop_reasonstringThe reason the message finished.
This may be one the following values:end_turn: the model reached a natural stopping point.max_tokens: we exceeded the requestedmax_tokensor the model's maximum.tool_use: the model invoked one or more tools.content_filter: the content was omitted due to a flag from our content filters.repetition_truncation: the model detects repetition.
end_turn,max_tokens,tool_use,content_filter,repetition_truncation - usageobjectBilling and rate-limit usage.Hide child attributesusage.input_tokensintegerThe number of input tokens which were used.usage.output_tokensintegerThe number of output tokens which were used.usage.cache_read_input_tokensinteger | nullThe number of input tokens read from the cache.
Streaming Response
- SSE.eventstringA string identifying the type of event described.
Available options:message_start,content_block_start,content_block_delta,content_block_stop,message_delta,message_stop - typestringEach server-sent event includes a named event type and associated JSON data.
Available options:message_start,content_block_start,content_block_delta,content_block_stop,message_delta,message_stop - messageobjectResponse message.Hide child attributesmessage.idstringThe message ID.message.typestringAvailable options:
messagemessage.rolestringAvailable options:assistantmessage.modelstringThe model name.message.contentarrayThe array of content blocks in the message.message.stop_reasonstring | nullThe reason the message finished. - indexintegerThe position of the content block within the message.。
- content_blockobjectThe content block that is starting.Hide child attributesHide child attributescontent_block.typestringThe header for a text content block; actual text arrives via subsequent delta events.
Available options:textcontent_block.textstringOften an empty string at start; text is appended viacontent_block_deltaevents of typetext_delta. - deltaobjectActual response content.Hide child attributesIncremental data for a content block.Hide child attributesdelta.typestringAvailable options:
text_delta,thinking_delta,input_json_deltadelta.textstringThe text part of the incremental data.delta.thinkingstringThe thinking part of the incremental data.delta.partial_jsonstringA JSON fragment string. Clients should concatenate fragments in arrival order to form the complete input JSON, then parse. - usageobject | nullBilling and rate-limit usage.Hide child attributesusage.input_tokensintegerThe number of input tokens which were used.usage.output_tokensintegerThe number of output tokens which were used.usage.cache_read_input_tokensinteger | nullThe number of input tokens read from the cache.
curl --location --request POST 'https://api.xiaomimimo.com/anthropic/v1/messages' \
--header "api-key: $MIMO_API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"model": "mimo-v2.5-pro",
"max_tokens": 1024,
"system": "You are MiMo, an AI assistant developed by Xiaomi. Today is date: Tuesday, December 16, 2025. Your knowledge cutoff date is December 2024.",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "please introduce yourself"
}
]
}
],
"top_p": 0.95,
"stream": false,
"temperature": 1.0,
"stop_sequences": null,
"thinking": {
"type": "disabled"
}
}'response
{
"id": "b966dbcad38c48b59d16d8c1f313681b",
"type": "message",
"role": "assistant",
"model": "mimo-v2.5-pro",
"stop_reason": "end_turn",
"content": [
{
"type": "text",
"text": "Hello! I'm MiMo, an AI assistant developed by Xiaomi. I'm here to help answer your questions, provide information, or assist with various tasks. My knowledge is up to date until December 2024. How can I help you today?"
}
],
"usage": {
"input_tokens": 57,
"output_tokens": 54
}
}Update Time July 17, 2026