Documentation

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

  • messagesarrayRequired
    Input messages. Each input message must be an object with a role and content.
    Each input message content may be either a single string or an array of content blocks, where each block has a specific type. Using a string for content is shorthand for an array of one content block of type text.
    Hide child attributes
    messages.rolestringRequired
    Role of the message.
    Available options: user, assistant
    messages.contentstring | arrayRequired
    Hide child attributes
    The text contents of the message.
  • modelstringRequired
    The model that will complete your prompt.
    Available options: mimo-v2.5-pro, mimo-v2.5
  • max_tokensinteger
    The 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: default 131072
    • mimo-v2.5: default 32768
    Required range: [1, 131072]
  • stop_sequencesarray
    Custom 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 response stop_reason of end_turn.
    If you want the model to stop generating when it encounters custom strings of text, you can use the stop_sequences parameter.
  • streambooleanDefault: false
    Whether to incrementally stream the response using server-sent events.
  • systemstring | array
    A system prompt is a way of providing context and instructions to model, such as specifying a particular goal or role.
    Hide child attributes
    The content of the system prompt.
  • temperaturenumber
    Sampling 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.5 models do not support customizing the temperature parameter. Even if this parameter is passed in, it will be forcibly overridden and take effect with the model's recommended default value of 1.0.
    • mimo-v2.5-pro, mimo-v2.5: default 1.0
    Required range: [0, 1.5]
  • thinkingobject
    Configuration for enabling model's extended thinking.
    Note: During the multi-turn tool calls process in thinking mode, the model returns a thinking content block alongside tool_use content block. To continue the conversation, it is recommended to keep all previous thinking content block in the messages array for each subsequent request to achieve the best performance.
    In thinking mode, the mimo-v2.5-pro, mimo-v2.5 models do not support customizing the temperature and top_p parameters. Even if these parameters are passed in, the actual effective values will be forcibly set by the model to its recommended default values of 1.0 and 0.95.
    Hide child attributes
    thinking.typestringRequired
    • mimo-v2.5-pro, mimo-v2.5: default enabled
    Available options: enabled, disabled
  • tool_choiceobject
    How the model should use the provided tools.
    Hide child attributes
    tool_choice.typestringRequired
    • auto means the model will automatically decide whether to use tools.
    Note: When a value other than auto is passed to type, the backend will remove this field by default, and the model response behavior will still be equivalent to the auto mode (this logic is subject to future adjustments).
    Available options: auto
    tool_choice.disable_parallel_tool_usebooleanDefault: false
    Whether to disable parallel tool use.
    If set to true:
    • When type is auto, the model will output at most one tool use.
  • toolsarray
    Definitions of tools that the model may use.
    If you include tools in your API request, the model may return tool_use content 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 using tool_result content blocks.
    Note: During the multi-turn tool calls process in thinking mode, the model returns a thinking content block alongside tool_use content block. To continue the conversation, it is recommended to keep all previous thinking content block in the messages array for each subsequent request to achieve the best performance.
    Each tool definition includes:
    • name: Name of the tool.
    • description: Optional, but strongly-recommended description of the tool.
    • input_schema: JSON schema for the tool input shape that the model will produce in tool_use output content blocks.
    Hide child attributes
    tools.namestringRequired
    Name of the tool.
    This is how the tool will be called by the model and in tool_use blocks.
    tools.descriptionstring
    Description 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.typestring
    Available options: custom
    tools.input_schemaobjectRequired
    JSON schema for the tool input shape that the model will produce in tool_use output content blocks.
    Hide child attributes
    tools.input_schema.typestringRequired
    The type of input_schema, only object is supported.
    Available options: object
    tools.input_schema.propertiesobject | null
    The properties of the tool input.
    tools.input_schema.requiredarray | null
    The list of properties that must be included in the tool input.
  • top_pnumberDefault: 0.95
    Use 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 by top_p. You should either alter temperature or top_p, but not both.
    Recommended for advanced use cases only. You usually only need to use temperature.
    In thinking mode, the mimo-v2.5-pro, mimo-v2.5 models do not support customizing the top_p parameter. Even if this parameter is passed in, it will be forcibly overridden and take effect with the model's recommended default value of 0.95.
    Required range: [0.01, 1.0]

Non-streaming Response

  • idstring
    Unique object identifier. The format and length of IDs may change over time.
  • typestring
    For Messages, this is always message.
  • rolestring
    Conversational role of the generated message. This will always be assistant.
  • contentarray
    Content generated by the model.
    Hide child attributes
    Hide child attributes
    content.textstring
    The content of the text.
    content.typestring
    The type of the content.
    Available options: text
  • modelstring
    The model that handled the request.
  • stop_reasonstring
    The 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 requested max_tokens or 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.
    Available options: end_turn, max_tokens, tool_use, content_filter, repetition_truncation
  • usageobject
    Billing and rate-limit usage.
    Hide child attributes
    usage.input_tokensinteger
    The number of input tokens which were used.
    usage.output_tokensinteger
    The number of output tokens which were used.
    usage.cache_read_input_tokensinteger | null
    The number of input tokens read from the cache.

Streaming Response

  • SSE.eventstring
    A string identifying the type of event described.
    Available options: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop
  • typestring
    Each 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
  • messageobject
    Response message.
    Hide child attributes
    message.idstring
    The message ID.
    message.typestring
    Available options: message
    message.rolestring
    Available options: assistant
    message.modelstring
    The model name.
    message.contentarray
    The array of content blocks in the message.
    message.stop_reasonstring | null
    The reason the message finished.
  • indexinteger
    The position of the content block within the message.。
  • content_blockobject
    The content block that is starting.
    Hide child attributes
    Hide child attributes
    content_block.typestring
    The header for a text content block; actual text arrives via subsequent delta events.
    Available options: text
    content_block.textstring
    Often an empty string at start; text is appended via content_block_delta events of type text_delta.
  • deltaobject
    Actual response content.
    Hide child attributes
    Incremental data for a content block.
    Hide child attributes
    delta.typestring
    Available options: text_delta, thinking_delta, input_json_delta
    delta.textstring
    The text part of the incremental data.
    delta.thinkingstring
    The thinking part of the incremental data.
    delta.partial_jsonstring
    A JSON fragment string. Clients should concatenate fragments in arrival order to form the complete input JSON, then parse.
  • usageobject | null
    Billing and rate-limit usage.
    Hide child attributes
    usage.input_tokensinteger
    The number of input tokens which were used.
    usage.output_tokensinteger
    The number of output tokens which were used.
    usage.cache_read_input_tokensinteger | null
    The 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

Copyright©2026 Xiaomi. All Rights Reserved | Cookie Policy | Cookie Preferences

We use cookies and similar technologies of our own to ensure the proper functioning of the website, customize content according to user preferences and analyze users' interactions on the website, as well as their browsing habits. You can find more information in our Cookie Policy. Select an option or go to Cookie Settings to manage your preferences. Learn More.